I am trying to convert csv to json. This CSV contains emojis, i guess that might be the problem.
csvtojson or any other module or even any custom method is returning unknown characters/garbage characters. My csv file link below:
The code i am using is:
let csvFilePath = path.join(\__dirname, 'reports/xyz.csv');
let str1 = fs.readFileSync(csvFilePath, { encoding: 'utf8' }).toString();
csv({noheader:true,output: "csv"}).fromString(str1).then((csvRow)=\>{console.log(csvRow)});
It is returning a bunch of \x00c\x00o\x00m\x00.\x00b\x00h\x00a\x00k\x00t\x00 characters.