UTF-16 or something else?

Skip Montanaro skip.montanaro at gmail.com
Tue Feb 9 11:32:11 EST 2021


>
> Try setting encoding to: "utf-8-sig".
>
> 'eb bb bf' is the byte order mark for UTF8 (most systems do not include
> this in UTF-8 encoded files)
>
> Python will correctly read UTF8 BOMs if you use the 'utf-8-sig' encoding
> when reading files
>

Excellent, thanks. That worked like a charm. Knowing what its called also
allowed me to look up more info.

Skip


More information about the Python-list mailing list