When I read a JSON file in node.js the non-english character display as '?' instead of the origin character.
The results from the stream is already in the wrong charset.
var fs = require('fs');
var path = require('path');
var stream = fs.createReadStream(path.join(__dirname,'../data.json'), 'utf8');
stream.on('error', function (error) {
response.status(500).send({ msg: error.message });
})
stream.pipe(response);
}
}
File example:
{
data: [
{"id":"111","name":"Dr. Per Änglund","phone":"7350-01794"},
{"id":"22","name":"Lars Änglund","phone":"1942-463945"}
]
}