rdf-ext / rdf-parser-csvw

CSV on the Web parser
MIT License
16 stars 4 forks source link

UTF BOM trips the parser #24

Closed tpluscode closed 4 years ago

tpluscode commented 4 years ago

If the input file is encoded with BOM then the first cell is not correctly parsed and it causes undefined value later on.

Specifically, the parsed column name is not correct and thus trying to refer to it by name on the row objects returns undefined values where the key is apparently missing.

The solution seems to be to use bom: true option on the csv-parse. For some reason it is false byt default although I don't think it can have any adverse effects.

I propose to set it to true by default in, maybe allowing to change back to false if necessary.