how to detect the encoding used for a specific text data ?

Christian Heimes christian at python.org
Thu Dec 20 15:19:37 CET 2012


Am 20.12.2012 12:57, schrieb iMath:
>  how to detect the encoding used for a specific text data ?

You can't.

It's not possible unless the file format can specify the encoding
somehow, e.g. like XML's header <?xml version="1.0" encoding="UTF-8"?>.
Sometimes you can try and make an educated guess. But it's just a guess
and it may give you wrong results.

Christian



More information about the Python-list mailing list