Reply to Re: Document Encoding/Charset

Your name:

Reply:


Posted by David Dorward on 06/21/07 16:19

On Jun 21, 5:15 pm, Pietro <pietro...@gmail.com> wrote:
> Im confused by these two lines that I include in my html:

> <?xml version="1.0" encoding="utf-8"?>

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.

> <meta http-equiv="content-type" content="text/html; charset=utf-8">

And if you are using XHTML then you're missing a slash.

> Can I choose any encodings I want here or is the correct choice
> related to how my editor saves my files?

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.

> Does using UTF-8 offer a portability advantage over the other encodings?

It can encode pretty much any character you are likely to need, and
does have wide support.

> How to choose?

If in doubt, UTF-8.

--
David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация