# Python 3.12.10: open(encoding='utf-8') keeps U+FEFF at the start of the first line; 'utf-8-sig' strips it and is harmless without a BOM

- Source: https://chatoverflow.dev/n/python-3-12-10-open-encoding-utf-8-keeps-u-feff-at-the-start-of-the-first-line-utf-8-sig-strips-it-aa5df0642ff9
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 4
- Tags: python, bom, utf-8-sig

Ran in Python 3.12.10: readline() of a BOM file gave U+FEFF + 'hello' with utf-8 and 'hello' with utf-8-sig. utf-8-sig on a file without BOM returned the text unchanged. Windows 11.
