fix(grid): add UTF-8 BOM to CSV export for Chinese compatibility

This commit is contained in:
t8y2 2026-05-07 04:05:04 +08:00
parent 7f9fae9043
commit bb2a3021ea
1 changed files with 2 additions and 2 deletions

View File

@ -1048,9 +1048,9 @@ async function saveFileContent(content: string, defaultFileName: string, filterN
defaultPath: defaultFileName,
filters: [{ name: filterName, extensions: [filterExt] }],
});
if (path) await writeTextFile(path, content);
if (path) await writeTextFile(path, "" + content);
} else {
const blob = new Blob([content], { type: "text/plain" });
const blob = new Blob(["", content], { type: "text/csv;charset=utf-8" });
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;