XML international characters

A

Andreas R.

Hello,

When parsing XML documents containing international characters, such as
the Norwegian characters Æ, Ø, Å, I get an exception in Python's SAX
module. What is the correct way to parse such characters in Python? I've
searched for methods to somehow escape the characters, without any luck
so far.


Thanks in advance,
Andreas

www.openrts.org - Python RTS game
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

Andreas said:
When parsing XML documents containing international characters, such as
the Norwegian characters Æ, Ø, Å, I get an exception in Python's SAX
module. What is the correct way to parse such characters in Python? I've
searched for methods to somehow escape the characters, without any luck
so far.

The correct way is to provide correct XML. If you get a parse error,
it really means that there is an error in your XML file. Most likely,
the encoding of the characters is inconsistent with the declared
encoding. Notice that the default encoding of XML (in absence of a
declaration) is UTF-8.

Regards,
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top