removing BOM prepended by codecs?

Peter Otten __peter__ at web.de
Tue Sep 24 07:06:46 EDT 2013


J. Bagg wrote:

> I'm having trouble with the BOM that is now prepended to codecs files.
> The files have to be read by java servlets which expect a clean file
> without any BOM.
> 
> Is there a way to stop the BOM being written?

I think if you specify the byte order explicitly with "UTF-16-LE" or 
"UTF-16-BE" no BOM is written.





More information about the Python-list mailing list