I tried the following test.js:
var fs = require('fs');
var prettyjson = require('prettyjson');
var data = {
"content": '\ufeffThis is an example with accents : é è à '
};
fs.writeFile('test.txt', JSON.stringify(data),'utf8', function (err) {});
but the output is:
{"content":"This is an example with accents : � � � "}
How can i use ISO-8859-1 to write to the file? May be some how iconv-lite? Thanks for the helps!
via kodaek99
No comments:
Post a Comment