Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Document Encoding/Charset
June 21, 2007, 4:15 pm
rate this thread
<?xml version="1.0" encoding="utf-8"?>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
Can I choose any encodings I want here or is the correct choice
related to how my editor saves my files? Does using UTF-8 offer a
portability advantage over the other encodings? How to choose?
Re: Document Encoding/Charset
You should not be including this line in XHTML served as text/html
(see Appendix C of the XHTML 1.0 spec). (For that matter, XHTML is
generally a poor idea on the WWW). If you aren't using XHTML then you
shouldn't be using it either.
And if you are using XHTML then you're missing a slash.
You need to specify the encoding the document is saved in. A good
editor will let you choose. Note that real HTTP headers trump any
claim in the document and that they are the correct place to tell the
client what encoding you are using.
It can encode pretty much any character you are likely to need, and
does have wide support.
If in doubt, UTF-8.