[Python-3000] BOM handling

"Martin v. Löwis" martin at v.loewis.de
Mon Oct 2 22:23:35 CEST 2006


Georg Brandl schrieb:
>>>>> b = (codecs.BOM_UTF8 + "hello").decode("utf-8")
>>>>> len(a)
>> 5
> 
> This behavior is questionable...

Indeed. Try

py> b = (codecs.BOM_UTF8 + "hello").decode("utf-8-sig")
py> len(b)
5

instead.

Regards,
Martin


More information about the Python-3000 mailing list