Eurosymbol in xml document

Richard Brodie R.Brodie at rl.ac.uk
Tue Mar 4 14:58:36 CET 2008


"Robert Bossy" <Robert.Bossy at jouy.inra.fr> wrote in message 
news:mailman.1583.1204634888.9267.python-list at python.org...

> If the file is declared as latin-1 and contains an euro symbol, then the file is 
> actually invalid since euro is not defined of in iso-8859-1.

Paradoxical would be a better description than invalid, if it contains
things that it can't contain. If you decoded iso-8859-15 as if it were
iso-8859-1, you would get u'\xa4' (Currency Sign) instead of the
Euro. From the original error:

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

that seems to be what happened, as you said. 





More information about the Python-list mailing list