2009/11/4 ximo wallas <igguana26 (AT) yahoo (DOT) com>
Quote:
I've been googling around but found no answer that works for me.
I'm loading some content from a PHP script using the load() function inside an html document
that already has the utf-8 encoding meta tag. I suposed that the rule at the head of the container
document will affect all loaded contents, but it doesn't. |
Just because your HTML document has a meta tag declaring that it's
UTF-8 doesn't necessarily make it so: the meta element is only used as
a fallback if the server hasn't specified the encoding in its HTTP
headers.
If you load your page in Firefox with Firebug's Net panel enabled,
you'll be able to see if the server is specifying an encoding which is
taking precedence: a response header like
Content-Type: text/html; charset=ISO-8859-1
would mean that the browser will treat your document as ISO-8859-1, no
matter what the meta tag says (in fact, the browser will never even
look at the meta tag if the header is present).
If, as it sounds from your description, the HTML is in a static file
rather than being dynamically generated, then bear in mind that it's
also necessary for that HTML document to actually _be_ UTF-8: in other
words, it should have been saved as UTF-8 by whatever editor was used
to create it.
Regards,
Nick.
--
Nick Fitzsimons
http://www.nickfitz.co.uk/