473,322 Members | 1,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Handling non-English letters in PHP

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
2 2352

"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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Hans-Joachim Widmaier | last post by:
Hi all. Handling files is an extremely frequent task in programming, so most programming languages have an abstraction of the basic files offered by the underlying operating system. This is...
2
by: aaj | last post by:
Hi all I have an automated application, that runs in the middle of the night. If certain 'non system' errors occur (things like malformed files, missing files etc..), I send an automatic Email...
12
by: Christian Christmann | last post by:
Hi, assert and error handling can be used for similar purposes. When should one use assert instead of try/catch and in which cases the error handling is preferable? I've read somewhere that...
34
by: rawCoder | last post by:
I have read that Exception Handling is expensive performance wise ( other than Throw ) , but exactly how ? Please consider the following example ... ////////////////// Code Block 1...
4
by: aaj | last post by:
Hi all I have an automated application, that runs in the middle of the night. If certain 'non system' errors occur (things like malformed files, missing files etc..), I send an automatic Email...
3
by: Mr Newbie | last post by:
I'm testing error handling configurations and having some trouble. I created a WebForm called. ErrDefault.aspx and I am trying to use the Page error attribute to force the redirection to a custom...
13
by: junw2000 | last post by:
Is C++ Exception handling useful? think it is too complicated. What kinds of project need to use it? Thanks.
35
by: jeffc226 | last post by:
I'm interested in an idiom for handling errors in functions without using traditional nested ifs, because I think that can be very awkward and difficult to maintain, when the number of error checks...
94
by: Chad | last post by:
On to top of page 163 in the book "The C Programming Langauge" by K & R, they have the following: char *strdup(char *s) { char *p; p=(char *)malloc(strlen(s)+1); if( p != NULL) strcpy(p,s):...
1
by: stephen | last post by:
Hi, I am a lil confused about exception handling. I have a main app and i am importing 2 DLL's. one of the DLL's is for connection/datasets etc and the other has logging errors to file.Both...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.