R. David Murray added the comment:

eryksun beat me to the answer, but I'm going to post mine anyway :)

If I understand the codecs docs correctly, this is because if you are 
specifying the endianess you want, it is a sign that you are only going to 
interpret it as that endianness, so there's no need for a BOM.  If you want a 
BOM, use utf-16/32.

In short, what is your use case for producing a UTF string with non-native byte 
order?  But as eryksun said, the Python supported way to do that and include a 
BOM is to write the BOM yourself.

----------
nosy: +lemburg, r.david.murray -eryksun
resolution: not a bug -> 
stage: resolved -> 
status: closed -> open

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25325>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to