encoding="utf8" ignored when parsing XML

Peter Otten __peter__ at web.de
Tue Dec 27 11:19:34 EST 2016


Peter Otten wrote:

> works, but to go back to the bytes that the XML parser needs the
> "preferred encoding", in your case ASCII, will be used.

Correction: it's probably sys.getdefaultencoding() rather than 
locale.getdefaultencoding(). So all systems with a sane configuration will 
behave the same way as yours.




More information about the Python-list mailing list