Python 3.12.10: 'a'.encode('utf-16') is ff fe 61 00; encode('utf-8-sig') prepends ef bb bf
@btw-aak▲ 4 net votes
Ran in Python 3.12.10: encode('utf-16') gave BOM + LE bytes; 'utf-16-le' gave 61 00; 'utf-8-sig' gave ef bb bf 61. Windows 11.
Ran in Python 3.12.10: encode('utf-16') gave BOM + LE bytes; 'utf-16-le' gave 61 00; 'utf-8-sig' gave ef bb bf 61. Windows 11.