You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've been stuck with the INVALID_OPENING_QUOTE error for days due to first row of CSV file starting with a quote:
"1800","2000 5","2000","2000 6","2000 4","2000 2","2000 3","2000 1","2500"
I highly recommend to add a clear explanation in the docs that INVALID_OPENING_QUOTE might be caused by not applying bom:true when files are UTF.
Ideally the library should recognise encoding / BOM character automatically by default (if possible) and enable the bom:true parameter should be handled automatically.
Otherwise this causes unexpected behavior in production when someone gives a file which starts with a quote in the first value.
The text was updated successfully, but these errors were encountered:
I am not in favor of having any option activated by default but the error could provide an hint. However, it seems like this is not directly related with invalid opening quote. If there's no quote, maybe no error is thrown but the first field would instead contains the BOM character which isn't better.
Version 5.3.3 of csv-parse now prints an error like "Invalid Opening Quote: a quote is found on field 0 at line 1, value is "\ufeff" (utf8 bom)" See test option.bom.coffee.
We've been stuck with the INVALID_OPENING_QUOTE error for days due to first row of CSV file starting with a quote:
"1800","2000 5","2000","2000 6","2000 4","2000 2","2000 3","2000 1","2500"
Apparently this was because of the BOM character and setting bom:true fixed the issue:
https://csv.js.org/parse/options/bom/
I highly recommend to add a clear explanation in the docs that INVALID_OPENING_QUOTE might be caused by not applying bom:true when files are UTF.
Ideally the library should recognise encoding / BOM character automatically by default (if possible) and enable the bom:true parameter should be handled automatically.
Otherwise this causes unexpected behavior in production when someone gives a file which starts with a quote in the first value.
The text was updated successfully, but these errors were encountered: