By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,723 Members | 1,876 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,723 IT Pros & Developers. It's quick & easy.

Handling non-English letters in PHP

P: n/a
I need to store data into XML that, often enough, is not in English. How
have you guys dealt with characters not found in the English language like
or or ? I have to store them as "å" in my XML file, however,
whenever I am doing evaluation somehow the "å" gets converted literally
to "" and when that displays in HTML it chokes, puts garbage BACK into the
XML file and it deteriorates further.

How can I ensure that when going back and forth between HTML, PHP and XML
that "å" REMAINS "å" AS IS???

Thanx
Phil
Jul 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"Phil Powell" <so*****@erols.com> wrote in message
news:Tdh5b.96391$xf.35294@lakeread04...
I need to store data into XML that, often enough, is not in English. How
have you guys dealt with characters not found in the English language like or or ? I have to store them as "å" in my XML file, however,
whenever I am doing evaluation somehow the "å" gets converted literally to "" and when that displays in HTML it chokes, puts garbage BACK into the XML file and it deteriorates further.

How can I ensure that when going back and forth between HTML, PHP and XML
that "å" REMAINS "å" AS IS???

Thanx
Phil


Try encoding it as UTF-8 instead of converting to entities.
Leslie
Jul 16 '05 #2

P: n/a
"Phil Powell" <so*****@erols.com> wrote
in message news:<Tdh5b.96391$xf.35294@lakeread04>...

I need to store data into XML that, often enough, is not in English.
How have you guys dealt with characters not found in the English
language like or or ?


The XML specification says,

Each external parsed entity in an XML document may use a different
encoding for its characters. All XML processors must be able to read
entities in both the UTF-8 and UTF-16 encodings.

http://www.w3.org/TR/2000/REC-xml-20001006#charencoding

which I take to mean that if you want to store non-Latin characters,
your best bet is to do it in UTF-16 encoding...

Cheers,
NC
Jul 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.