You are here: Re: outputting XML from PHP « PHP Programming Language « IT news, forums, messages
Re: outputting XML from PHP

Posted by Tim Hunt on 08/04/06 08:32

runner7 wrote:
> Tim,
>
> Thanks for your very helpful reply. After looking over the material in
> the links you specified, I would suppose that web servers sending out
> content from scripted applications generally automatically use
> ISO-8859-1 for character set. Therefore, I am guessing that no matter
> what I put as header, I am going to get ISO-8859-1, so I may as well
> use that in the header. Does this sound right to you, or does anyone
> reading this know if this is correct? Thanks ahead of time for your
> replies.

Hi, I think I left myself open to misinterpretation.

If you set the character set in the header it will always override the
default, if the default is ok then you can safely leave the charset
blank.

The usual default (for http requests, scripted or not) is iso-8859-1
but text/xml is an exception.

This is cut n paste from rfc3023 section 3.1.

if a text/xml entity is received with
the charset parameter omitted, MIME processors and XML processors
MUST use the default charset value of "us-ascii"[ASCII]. In cases
where the XML MIME entity is transmitted via HTTP, the default
charset value is still "us-ascii". (Note: There is an
inconsistency between this specification and HTTP/1.1, which uses
ISO-8859-1[ISO8859] as the default for a historical reason. Since
XML is a new format, a new default should be chosen for better
I18N. US-ASCII was chosen, since it is the intersection of UTF-8
and ISO-8859-1 and since it is already used by MIME.)

Btw I really should have mentioned that if you want you can change the
default charset that your web server send out by changing php.ini or
httpd.conf (assuming you use apache). This can be overridden later if
you set the charset in header().

Google threw up this example of changing the charset in php.ini and
httpd.conf
http://dev.budts.be/item/64

Regards, Tim

 

Navigation:

[Reply to this 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

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