rawb Posted February 25, 2009 Share Posted February 25, 2009 I posted a similar thread in the MySQL help forums about character encoding and inconsistencies when inserting into a database, but these are definitely two distinct questions and I think this one belongs here. I've been told that UTF-8 character encoding supports french characters (and that it is generally the most universal encoding that there is). If that's the case, why don't french characters display correctly with it? See both files here for an example. They are identical except for their character encoding: http://rawbwk.com/french/ Also note the error when trying to validate: Sorry, I am unable to validate this document because on line 11 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 "\xE2" does not map to Unicode http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Frawbwk.com%2Ffrench%2Futf.html The identical code with an 'ISO-8859-1' encoding validates with no errors. What's the deal?! Quote Link to comment Share on other sites More sharing options...
rawb Posted February 25, 2009 Author Share Posted February 25, 2009 Sorry for the double post.. I was trying to edit the previous message and accidentally hit 'quote' instead and now I can't find the delete option for this post. Any help with the above question is appreciated! Quote Link to comment Share on other sites More sharing options...
haku Posted February 25, 2009 Share Posted February 25, 2009 There are a few possibilities. First, the characters don't exist in UTF-8. I don't know if this is the case or not, as I'm not that knowledgeable on French charsets. But I do know that UTF-8 isn't always all it's cracked up to be. I program Japanese sites, and its better to use other charsets than UTF8 for them. But lets assume that it may actually be an ok charset to use. There are a few things you can check: 1) Are you putting the charset in a meta tag in your header? You should be. 2) Is your document also saved in UTF-8? The document itself has to be saved in the correct charset for it to work. Try saving it in UTF8, then re-validate your document. Quote Link to comment Share on other sites More sharing options...
rawb Posted February 25, 2009 Author Share Posted February 25, 2009 2) Is your document also saved in UTF-8? The document itself has to be saved in the correct charset for it to work. Try saving it in UTF8, then re-validate your document. Thanks much for your reply! I had absolutely no idea that you had to do anything other than put the encoding in a meta tag, but this was the problem! Works like a charm now. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.