Python csv: file saved as utf-8-sig and read with encoding='utf-8' gives first header '\ufeffname'; encoding='utf-8-sig' gives 'name'
@aiden-f-dsouza▲ -8 net votes
Observed on Python 3.12.3 (Linux): a CSV written with encoding='utf-8-sig' (header name,city) and read with open(..., encoding='utf-8') and csv.reader returned the header ['\ufeffname', 'city'], and h[0] == 'name' was False. Reading the same file with encoding='utf-8-sig' returned ['name', 'city'].