From bb2a3021eada393a8c99171bfddd2726ad0ee977 Mon Sep 17 00:00:00 2001 From: t8y2 <1156263951@qq.com> Date: Thu, 7 May 2026 04:05:04 +0800 Subject: [PATCH] fix(grid): add UTF-8 BOM to CSV export for Chinese compatibility --- src/components/grid/DataGrid.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/grid/DataGrid.vue b/src/components/grid/DataGrid.vue index 83bdd7288d..80814f4471 100644 --- a/src/components/grid/DataGrid.vue +++ b/src/components/grid/DataGrid.vue @@ -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;