Jump to content

Utf-8


jarrett000

Recommended Posts

I tired validating the page and I got this error: "Sorry, I am unable to validate this document because on line 311 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 "\xA9" does not map to Unicode"The code on 311, However, is:

<input type='button' value='Decline' onClick='Google()' name='DD' />

So what's the problem? I don't understand it AT ALL----------------------------------------------------------------------------------------------------------------------My scond problem id that it days in one of my javascripts i cant use &, I need to use &which causes the script to not work ...............?

Link to comment
Share on other sites

Hi Jarrett,I read a bunch of stuff trying to help you out here. From what I've come to understand is first that \xA9, is referring to a 'copyright' symbol...So first I would say check if your document makes use of one, as it will cause a problem. Secondly people that were having the same validating problem as you, discovered that whatever environment saved their file into the utf-8 format, didn't do so directly - there was some sort of conversion that took place. During the conversion process some information was added to their file which caused the same error.I found several specific examples referring to your problem. One guy had an error on the last line of his document, a simple <html> tag rested there. Yet he was still getting the same error as you. I hope anything I've mentioned is of help, please post when you've found a solution (if not through here) I'm interested as to what the cause is for future reference (and how to fix it!)Kindest Regards,Alan

Link to comment
Share on other sites

Hi Jarrett,I read a bunch of stuff trying to help you out here. From what I've come to understand is first that \xA9, is referring to a 'copyright' symbol...So first I would say check if your document makes use of one, as it will cause a problem. Secondly people that were having the same validating problem as you, discovered that whatever environment saved their file into the utf-8 format, didn't do so directly - there was some sort of conversion that took place. During the conversion process some information was added to their file which caused the same error.I found several specific examples referring to your problem. One guy had an error on the last line of his document, a simple <html> tag rested there. Yet he was still getting the same error as you. I hope anything I've mentioned is of help, please post when you've found a solution (if not through here) I'm interested as to what the cause is for future reference (and how to fix it!)Kindest Regards,Alan
I also had the same error message and found it was indeed the © symbol. I also got the same error with the degree symbol as in 45 °C. To overcome this error I used Windows-1252 for character encoding in those files.
Link to comment
Share on other sites

I have no issues with Symbols in my pages. Make sure that you use a good Text Editor that works in UTF-8 and save the copies on the Server as UTF-8 as well. I use Context Editor on Windows and Gedit on Linux.

Link to comment
Share on other sites

I would recommend using HTML entities instead, they are much more browser and text-editor compatible.http://www.w3schools.com/tags/ref_entities.asp
That's just recommended if you're on ISO-8859-1 not in UTF-8. Better suggestion is what jlhaslip already did
I have no issues with Symbols in my pages. Make sure that you use a good Text Editor that works in UTF-8 and save the copies on the Server as UTF-8 as well. I use Context Editor on Windows and Gedit on Linux.
Although I use Notepad++ :)
Link to comment
Share on other sites

I did have a copyright symbol, as I removed it the error was cleared. Anyone know what's up with the JS?
As said for the copyright symbol (and any others that may eventually arise) - use an editor that will save the file as UTF-8. Notepad does it - check the "Encoding" dropdown in the save dialog.As for the ampersands, there are two ways of resolving this.The first, and the reccomended one is to move all of your JS into a separate file. This will not only eliminate this error, but should also make maintainance easier.The second way is to place a CDATA around the JS code, and comment out the CDATA to prevent old browsers (I think IE6?) from creating an error because of it:
<script type="text/javascript">//<![CDATA[/*JS goes here*///]]></script>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...