NodeJs 读写文件中文问题
const fs = require('fs');
const iconv = require('iconv-lite');
let data = fs.readFileSync('./1.txt');
data = iconv.decode(data, 'gb2312');
console.log(data);
let result = '你好';
result = iconv.encode(result, 'gbk');
fs.writeFileSync('./3.txt',result);