Eurosymbol in xml document

Hellmut Weber mail at hellmutweber.de
Tue Mar 4 13:09:52 CET 2008


Hi,
i'm new here in this list.

i'm developing a little program using an xml document. So far it's easy 
going, but when parsing an xml document which contains the EURO symbol 
('€') then I get an error:

UnicodeEncodeError: 'charmap' codec can't encode character u'\xa4' in 
position 11834: character maps to <undefined>

the relevant piece of code is:

from xml.dom.minidom import Document, parse, parseString
...
doc = parse(inFIleName)


leo at brunello usexml $ locale
LANG=de_DE at euro
LC_CTYPE="de_DE at euro"
LC_NUMERIC="de_DE at euro"
LC_TIME="de_DE at euro"
LC_COLLATE="de_DE at euro"
LC_MONETARY="de_DE at euro"
LC_MESSAGES="de_DE at euro"
LC_PAPER="de_DE at euro"
LC_NAME="de_DE at euro"
LC_ADDRESS="de_DE at euro"
LC_TELEPHONE="de_DE at euro"
LC_MEASUREMENT="de_DE at euro"
LC_IDENTIFICATION="de_DE at euro"
LC_ALL=de_DE at euro


any help appreciated

Hellmut

-- 
Dr. Hellmut Weber         mail at hellmutweber.de
Degenfeldstraße 2         tel   +49-89-3081172
D-80803 München-Schwabing mobil +49-172-8450321
please: No DOCs, no PPTs. why: tinyurl.com/cbgq




More information about the Python-list mailing list