Guessing the encoding from a BOM

Chris Angelico rosuav at gmail.com
Thu Jan 16 19:14:17 EST 2014


On Fri, Jan 17, 2014 at 6:37 AM, Albert-Jan Roskam <fomcl at yahoo.com> wrote:
> Can you elaborate on that? Unless your utf-8 files will only contain ascii characters I do not understand why you would not want a bom utf-8.

It's completely unnecessary, and could cause problems (the BOM is
actually whitespace, albeit zero-width, so it could effectively indent
the first line of your source code).  UTF-8 specifies the byte order
as part of the protocol, so you don't need to mark it.

ChrisA



More information about the Python-list mailing list