ElementTree cannot parse UTF-8 Unicode?
Erik Bethke
erikbethke at gmail.com
Wed Jan 19 19:35:23 EST 2005
Hello Fredrik,
1) The exact error is in line 1160 of self._parser.Parse(data, 0 ):
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 3,
column 16
2) You are right in that the print of the file read works just fine.
3) You are also right in that the digitally encoded unicode also works
fine. However, this solution has two new problems:
1) The xml file is now not human readable
2) After ElementTree gets done parsing it, I am feeding the text to a
wx.TextCtrl via .SetValue() but that is now giving me an error message
of being unable to convert that style of string
So it seems to me, that ElementTree is just not expecting to run into
the Korean characters for it is at column 16 that these begin. Am I
formatting the XML properly?
Thank you,
-Erik
More information about the Python-list
mailing list