Validation says "Sorry, unable to validate" - WTF?

Status
Not open for further replies.

bobsoap

Together we can do anyone
Sep 16, 2008
605
16
0
soapdesigned.com
Ok so I just encountered something I never have before.

Upon running a page through the W3 Validator, it gives me this error:

Sorry! This document can not be checked.

Sorry, I am unable to validate this document because on line 137 it contained one or more bytes that I cannot interpret as utf-8 (in other words, the bytes found are not valid values in the specified Character Encoding). Please check both the content of the file and the character encoding indication.
The error was: utf8 "\x85" does not map to Unicode
...and it doesn't show anything else. This is not a "error(s) found in line X" type of unvalidated result, but the validator just gives up and does nothing.

I'm having this

Code:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
in the header and I can't find anything out of the ordinary on line 137. What kind of a :repuke: error is this?
 


If it's a static page, copy/paste the code into a new notepad file, Save As [filename].html, making sure you choose "All Files" as the filetype and UTF-8 as the encoding.

If the code is being generated by something like php and it is literal output, you could do the same procedure, just with the php file instead.

If it is dynamically generated, like from a db or xml file, (using php) you can try running that string output through a function like utf8_encode()

Alternatively, you can use CDATA tags to keep the parser out of the feed output.
 
Thanks jryan, I just found out why that was. The problem was that at the mentioned line, there was nothing wrong. It seems as if the validator can't pinpoint exactly where the problem is when it's a charset issue, and the line it mentioned (137) rather means "on any line between 1 and 1000". Duh.

Anyway, I found one silly » that wasn't encoded. It was somewhere on line 100 or so. I just deleted lines and sections bit by bit and narrowed it down that way. It took me an hour to find that sucker.

Thanks anyway, the utf8_encode() is a great idea (it's a php) - I will remember that! +rep
 
Status
Not open for further replies.