On Sat, Jan 23, 2021, at 08:00, Stephen J. Turnbull wrote: > I see very little use in detecting the BOMs. I haven't seen a UTF-16 > BOM in the wild in a decade (as usual for me, that's Japan-specific, > and may be limited to the academic community as well), and the UTF-8 > BOM is a no-op if the default is UTF-8 anyway.
It's not *entirely* a no-op, you'd want the decoder to consume the leading BOM rather than returning '\ufeff' on the first read. And AIUI they're much more common on Windows (being able to detect UTF-16 *without* BOMs might be useful as well, but has historically been a source of problems on Windows) - until recently all UTF-8 or UTF-16 files saved with notepad would have them. _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/GNV2JJVRUI5QGXRAA6VTZYNPCD7OGVNA/ Code of Conduct: http://python.org/psf/codeofconduct/