ignoring chinese characters parsing xml file

limodou limodou at gmail.com
Tue Oct 23 03:05:20 EDT 2007


On 10/23/07, Fabian L¨®pez <fabian at syameses.com> wrote:
> Hi,
> I am parsing an XML file that includes chineses characters, like
> ^ÔuÔuà¢à¢²ÅÊDZw.¼ššìéLï³²ÅÊÇÛ or ¥Ø¥¢¥¢¥¤¥í¥ó... The problem is that I get an error like:
> UnicodeEncodeerror:'charmap' codec can't encode characters in position....
> The thing is that I would like to ignore it and parse all the characters
> less these ones. So, could anyone help me? I suppose that I can catch an
> exception that ignores it or maybe use any function that detects this
> chinese characters and after that ignore them.
>
Sorry, that's not Chinese but Japanese. And I don't know which
encoding is in the source xml, because most of xml files should be
encoded in utf-8, and it'll be ok for CJK characters, and how did you
get this error?

-- 
I like python!
UliPad <<The Python Editor>>: http://code.google.com/p/ulipad/
meide <<wxPython UI module>>: http://code.google.com/p/meide/
My Blog: http://www.donews.net/limodou


More information about the Python-list mailing list