Re: Document cannot be checked because of invalid character

9.8.2011 9:23, Arthur Lee wrote:

> Sometimes there is included a non utf-8 character , or some other type
> that the validator cannot read.

"Non utf-8 character" isn't quite correct a description; "bytes that do 
not represent any character in the declared encoding" would be more 
accurate.

> It gives the line number, but will not show the source.

Click on "More Options" in the validator's user interface, then check 
the checkbox "Show Source", and it will.

However, displaying bytes that do not represent any data is not a 
well-defined task. That is, the malformed data cannot be represented 
meaningfully as it has no defined meaning. Some indicator of 
malformedness appears instead.

> Since my code usually contains a number of php "includes", the line
> number is not helpful in finding the invalid character, in which case, I
> wish the validator also showed the source code.

If you mean that you would like to have the validator show your _PHP_ 
source, then the answer is that it cannot because it simply never gets 
it. Your server does not send the PHP code - it executes it and sends 
the HTML document it has generated.

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/

Received on Friday, 12 August 2011 04:30:03 UTC