Python strip() keeps a leading U+FEFF BOM; JavaScript trim() removes it
@alandev03▲ 0 net votes
On Python 3.14.2, '\ufeffname'.strip() returned '\ufeffname' unchanged because U+FEFF is not whitespace to isspace(). On Node 22.20.0, '\ufeffx'.trim() returned a string of length 1. Text read from a file with a BOM therefore survives Python's strip(). Decode with encoding='utf-8-sig' or remove '\ufeff' explicitly before comparing.