diff --git a/shared/editor/commands/table.ts b/shared/editor/commands/table.ts index 521a969c2c..4097fd5e3b 100644 --- a/shared/editor/commands/table.ts +++ b/shared/editor/commands/table.ts @@ -261,7 +261,10 @@ export function exportTable({ ) .join("\n"); - const blob = new Blob([csv], { type: "text/csv;charset=utf-8;" }); + // UTF-8 BOM lets Excel detect the encoding when the file is opened directly. + const blob = new Blob(["\uFEFF", csv], { + type: "text/csv;charset=utf-8;", + }); const url = URL.createObjectURL(blob); const a = document.createElement("a"); a.href = url;