今天爱分享给大家带来nodejs中文乱码问题如何解决【附代码】,希望能够帮助到大家。
1.下载iconv-lite
npm i iconv-lite
2.axios配置
axios.get(url,{responseType:"arraybuffer"})
3. 将页面数据解码保存
let str = iconv.decode(Buffer.from(data),'gbk')
4.将str转码并转为字符串
let html = iconv.encode(str,'utf8').toString() //输出console.log(html)
 原文链接:https://blog.itblood.com/1381.html,转载请注明出处。		    			
		            
![与母亲荒岛性爱的一周1.0AI汉化版[PC+安卓/1.97G/更新]A Week of Deserted Island Sex with my Step-Mom [v1.00] [Arukutsuuru] [日系RPG/AI汉化]](/wp-content/uploads/replace/2025/07/19/e106196b2825f1a85ca6791f1e0faecd.webp)