I'm trying to parse a CSV file that contains utf8 characters in Node.js.
Here's my code :
fs.readFile(path + files[i], 'utf-8', function(err, data) {
if(err) { console.log(err); }
console.log(data);
// do something
});
The problem is that for some reason, the utf8 characters don't display properly (� in place of the real character).
I tried replaceing 'utf8' by 'utf-8' or write the whole object:
{encoding: 'utf8'}
but neither of these methods worked.
Later in my program, I'm sending the data to the browser with socket.io but this doesn't change anything making me believe that the issue isn't the terminal / browser.
Thanks in advance !