root 1 рік тому
батько
коміт
644b4a4578
1 змінених файлів з 2 додано та 2 видалено
  1. 2 2
      js/excel.js

+ 2 - 2
js/excel.js

@@ -6,8 +6,8 @@ exceltoxlxstream = async function (file) {
             const reader = new FileReader();
             reader.onload = async function (e) {
                 const data = new Uint8Array(e.target.result);
-                const workbook = XLSX.read(data, { type: 'array' });
-                const fileStream = XLSX.write(workbook, { type: 'array', bookType: 'xlsx' });
+                const workbook = XLSX.read(data, { type: 'array', codepage: 936 });
+                const fileStream = XLSX.write(workbook, { type: 'array', bookType: 'xlsx', codepage: 936 });
                 const blob = new Blob([fileStream], { type: 'application/vnd.ms-excel;charset=utf-8' });
                 const url = URL.createObjectURL(blob);
                 // 创建隐藏的下载链接并点击