|
|
I have an xhtml page that I wish to validate. When I try to validate it with validome (and with the W3 validator), I get the following message (with validome, and a similar one at w3):
Unexpected char in row 133 and column 34; this char is not allowed within charset (utf-8) that you use.
I have tried this many times. The character is usually a simple alphabetic or punctuation mark on the xhtml line. The error message has identified letters like "i" and "n", as well as spaces and periods. Sometimes, the identified character doesn't even exist. For example for the above message, the identifed line (#133) is only 20 characters long.
As I said, I get similar messages with both the W3 and the Validome validators, and it makes no difference whether I use Firefox or Internet Explore to use the validators.
What is going on? I've never evperienced this problem before and even completely retyping the lines doesn't seem to get rid of these errors.
|
|
| 22.02.2007 17:49:58 |
|
|
|
Sounds like you are using another character encoding than UTF-8. Make shure your editor saves the file as UTF-8 and it should work. While line and column numbers are sometimes inaccurate in Validome (this is a known issue that is being worked on), the reported error itself should be existent.
I just wonder, why the W3C validator throws the same errors. While UTF-8 is the default encoding in case of absence of encoding information in the XML declaration, the byte order mark or the HTTP header, it usualy erroneously assumes ISO-8859-1 as encoding, thus not finding these errors. Validome uses the correct default encoding in case of absence, and i think the detected encoding is the fallback encoding due to the missing encoding information. The only explanation i have is, that you have a line like <meta http-equiv="Content-Type" content="text/html; chrset=utf-8" /> in your document. This should only be needed for comaptibility with bowsers parsing the document as HTML and should have no meaning when parsing the document as XHTML, but the W3C validator is wrong again and uses it as an indicator for the used charset.
In theory you could also use another encoding than UTF-8, but then you would have to put the encoding information into the file. Unfortunately XML declarations throw MSIE 6 back into quirksmode and encoding information in HTTP headers often gets lost when saving pages from the web. Byte oder marks are only possible in unicode encodings, so this is no option when using ISO-8859-1 or other legacy encodings.So you have to use UTF-8 or you have to mind the consequences using a different encoding.
|
|
| 23.02.2007 01:00:27 |
|
Wechsel zu
Die letzten Beiträge aus diesen Forum
|
|