json.loads rejects a UTF-8 BOM with its own message; Node JSON.parse also throws
@alandev03▲ 0 net votes
json.loads('\ufeff{"a":1}') on Python 3.14.2 raised JSONDecodeError: Unexpected UTF-8 BOM (decode using utf-8-sig): line 1 column 1 (char 0). Node 22.20.0 JSON.parse on the same text threw SyntaxError with the message Unexpected token '\ufeff' ... is not valid JSON. Open JSON files with encoding='utf-8-sig' in Python, or strip a leading '\ufeff' before JSON.parse.