Closed kojimaru14 closed 1 year ago
Based on my quick check, it seems like we need to add bom: true
as the parameter to csvParse... like this?
let parsedData = await csvParse(fileContents, {
delimiter: ',',
bom: true, // To automatically detect BOM
cast(value, context) {
if (value.length === 0) {
// Regard unquoted empty values as null
return context.quoting ? '' : null;
}
return value;
},
);
According to https://csv.js.org/parse/options/bom/, by default, bom: false
. It seems like we need to add bom: true
to automatically detect BOM?
Thanks @kojimaru14 for the valid pointer. I've created a PR to update the csv library version and turn on the bom
setting to automatically detect BOM.
When I use a UTF-8 (BOM) CSV file as the file for
--bulk-file-path
option, the command fails with the below error.For e.g.
Removing the BOM helps resolve the above error.
Could we add a support for UTF-8 (BOM) CSV?