数据库是gbk,如何把取出的数据,转为utf8的?
数据库是gbk,如何把取出的数据,转为utf8的?
2 回复
https://npm.mirror.cqupt.edu.cn/package/iconv-lite var iconv = require(‘iconv-lite’); // Convert from js string to an encoded buffer. var utf8 = iconv.encode(iconv.decode(raw, ‘gbk’), ‘utf-8’);