Reply to Re: non-utf characters and XML

Your name:

Reply:


Posted by Rik Wasmus on 11/08/07 07:29

On Thu, 08 Nov 2007 08:10:11 +0100, Martin Mandl - m2m tech support =

<martin.mandl@gmail.com> wrote:

> On Nov 8, 7:02 am, Toine <bapo...@gmail.com> wrote:
>> Hello,
>>
>> My problem:
>> I'm using PHP to dynamically create an XML document. However, some of=

>> my data (from MySQL) contains non-UTF characters such as the umlaut.
>> Naturally, browsers like IE 7 throw an error when attempting to parse=

>> these characters. I understand that these characters are invalid for
>> XML.
>>
>> My question:
>> What is the best to handle these characters when creating XML
>> documents on the fly? It seems like searching and replacing these
>> characters would be complicated, and there must be an easier way.
>>
>> Thanks!
>
> Actually Umlauts are in UTF-8. But you should tell your browser which
> character set you are using.

Indeed. When using UTF-8, avoid a BOM btw.

> You could do that in the xml header, e.g.
> <?xml version=3D"1.0" encoding=3D"utf-8"?>
>
> or set it in the header using php, e.g.
> header('content-type: text/html; charset=3Dutf-8');

Do serve XML as XML though, it isn't HTML.
-- =

Rik Wasmus

[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

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