Ignoring incorrect XML encoding declarations

Peter Scott sketerpot at chase3000.com
Thu Jan 16 20:44:57 CET 2003

Andrew Dalke wrote:
> import codecs
>    ...
>       infile = codecs.EncodedFile(infile, "utf-8", "iso-8859-1")

Thanks, that looks like it'll solve my problem nicely. Right now I'm
using the expat technique that Martin v. Löwis suggested, which solves
the problem nicely and probably is quite fast, but it assumes that the
user has expat. I think I'll end up using your solution with SAX for
compatibility with other parsers.


More information about the Python-list mailing list