update at 2026-02-14 11:01:22

This commit is contained in:
douboer@gmail.com
2026-02-14 11:01:22 +08:00
parent 53c7fa7b81
commit 78896060b2
3 changed files with 20 additions and 9 deletions

View File

@@ -82,7 +82,11 @@ export function parseCsvText(csvText: string): RawTable {
* 解析 xlsx 的二进制数据。
*/
export function parseXlsxBuffer(buffer: ArrayBuffer): RawTable {
const workbook = XLSX.read(buffer, { type: 'array' });
const workbook = XLSX.read(buffer, {
type: 'array',
// 兼容部分旧版 xls 在浏览器环境下的中文 codepage 解析。
codepage: 936
});
const firstSheetName = workbook.SheetNames[0];
if (!firstSheetName) {