writing Unicode objects to XML

Martin v. Löwis martin at v.loewis.de
Mon May 5 17:44:42 EDT 2003


Alessio Pace <puccio_13 at yahoo.it> writes:

> I mean, they are strange characters, but the
> weird thing is that parsing over again the file.xml I get the same Unicode
> objects as when I read it for the first time with characters references as
> content.

Why do you think they are strange characters? Because your editor
tells you? Don't trust your editor, then - use an editor instead that
properly understands XML encodings, or, atleast, can be configured to
use encodings different from your locale's encoding.

Or did you perhaps try printing it to the console? Same issue: You
need to get a different console, one that uses the encoding of the XML
file, not some encoding that the vendor of the console software though
might be a good idea to use. That particular vendor may be interested
in compatibility with a system developed 20 years ago, whereas you
are using an encoding that is just 10 years old.

Regards,
Martin




More information about the Python-list mailing list