js-xlsx 的read(),options 可以指定codepage.就不需要引用codepagele ,源码中js-xlsx已经合并了codepage。不需要重复引入了。而且codepage在node模式下调用时有异常的了。大佬可以试一试。
if (isUTF8Flag) {
workbook = XLSX.read(val.target.result, { type: 'binary' })
} else {
// codepage 对默认的Excel编码进行转换
workbook = XLSX.read(result, { type: 'binary', codepage: 936 })
}
不过总的还是谢谢大佬科普!!!
![240](https://cdn2.jianshu.io/assets/default_avatar/1-04bbeead395d74921af6a4e8214b4f61.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/240/h/240)