XML international characters

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andreas R.

    #1

    XML international characters

    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
  • Martin v. Löwis

    #2
    Re: XML international characters

    Andreas R. wrote:[color=blue]
    > 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.[/color]

    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

    Comment

    Working...