Skip to content

Commit 86829d4

Browse files
chaxusclaude
andcommitted
content(csv): explain CSV mojibake and the automatic GB18030/UTF-8 detection on the csv-to-xlsx pages
Also corrects stale copy claiming an import dialog lets you pick the delimiter/encoding: v9 sniffs both automatically (SheetJS + decodeCsvBytes). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 1e3d156 commit 86829d4

3 files changed

Lines changed: 51 additions & 12 deletions

File tree

‎docs/superpowers/plans/2026-08-15-next-phase-roadmap.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,11 @@ Breadcrumb)、页脚互链全齐;robots.txt / sitemap.xml / llms.txt 三件
7979
/open/docx;同时新增 `test/unit/landing-pages.test.ts` 钉住全部落地页的
8080
canonical/hreflang/JSON-LD/sitemap/双语互指契约,见
8181
docs/explorations/2026-08-16-pdf-landing-and-landing-contract.md。
82-
2. **CSV 中文乱码长尾强化**:zh-CN 侧价值最高的词是"CSV 乱码/GBK 乱码
83-
修复"。在 convert/csv-to-xlsx 中文页增补一节"为什么别的工具打开中文
84-
CSV 会乱码、本工具如何检测编码",FAQ 加对应问答;评估独立页
85-
`/fix/csv-garbled`(zh 优先,en 后补)。
82+
2. ✅ 2026-08-16(前半)**CSV 中文乱码长尾强化**:convert/csv-to-xlsx 中文页
83+
加"为什么别的工具打开中文 CSV 会乱码"一节 + 两条 FAQ(含 JSON-LD)+
84+
description 带词;英文页同步,并修正了两页里"导入步骤可选编码"的过期
85+
说法(v9 走 SheetJS 自动嗅探,没有导入对话框)。独立页 `/fix/csv-garbled`
86+
待 GSC 数据再定。
8687
3. ✅ 2026-08-16 **只读/预览模式说明**:embed 落地页(en + zh)增补
8788
"Read-only and preview mode" 一节 + FAQ + FAQPage JSON-LD;docs/embed-api.md
8889
本就有该节;页面里的 API 参考链接改指站内 /help/embed-api。

‎public/convert/csv-to-xlsx.html‎

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,15 @@
105105
"name": "What delimiter and encoding does it expect?",
106106
"acceptedAnswer": {
107107
"@type": "Answer",
108-
"text": "It defaults to standard comma-separated values, and the OnlyOffice import lets you choose a different delimiter or text encoding if your file needs it."
108+
"text": "Comma, semicolon or tab are detected automatically, and so is the encoding: UTF-8 (with or without BOM), GB18030 / GBK for Chinese ANSI exports, and Latin-1 as the last resort."
109+
}
110+
},
111+
{
112+
"@type": "Question",
113+
"name": "My CSV shows garbled characters (mojibake) in other tools — will it here?",
114+
"acceptedAnswer": {
115+
"@type": "Answer",
116+
"text": "Usually not. Mojibake means the file was saved in a legacy code page (GBK / GB18030, Latin-1) and opened as UTF-8. This converter sniffs the bytes first, so Chinese exports from Excel open correctly, and saving writes UTF-8 with a byte-order mark that Excel reads without a wizard."
109117
}
110118
},
111119
{
@@ -244,9 +252,10 @@ <h2>How it works</h2>
244252
<p>
245253
The conversion is handled by OnlyOffice's x2t engine compiled to WebAssembly, which targets the common office
246254
and text formats — Word, Excel and PowerPoint plus PDF, TXT, HTML and CSV. Because it runs in the browser tab
247-
there is no upload queue and no server-imposed size cap, and your data never touches the network. It defaults to
248-
comma-separated values, and the import step lets you pick a different delimiter or text encoding — and mark
249-
number, date or text columns — before you save the result as XLSX.
255+
there is no upload queue and no server-imposed size cap, and your data never touches the network. The delimiter
256+
(comma, semicolon or tab) and the text encoding are detected automatically — strict UTF-8 first, then GB18030
257+
(the "ANSI" encoding Excel uses for Chinese exports), then Latin-1 — so files that show mojibake elsewhere open
258+
with the right characters here. Mark number, date or text columns in the sheet, then save the result as XLSX.
250259
</p>
251260

252261
<p>
@@ -279,7 +288,14 @@ <h3>Will number and date columns be detected?</h3>
279288
</p>
280289
<h3>What delimiter and encoding does it expect?</h3>
281290
<p>
282-
Standard comma-separated values by default; the import lets you pick a different delimiter or text encoding.
291+
Comma, semicolon or tab are detected automatically, and so is the encoding: UTF-8 (with or without BOM),
292+
GB18030 / GBK for Chinese "ANSI" exports, and Latin-1 as the last resort.
293+
</p>
294+
<h3>My CSV shows garbled characters (mojibake) in other tools — will it here?</h3>
295+
<p>
296+
Usually not. Mojibake means the file was saved in a legacy code page (GBK / GB18030 for Chinese, Latin-1 for
297+
Western European) and opened as UTF-8. This converter sniffs the bytes first, so Chinese exports from Excel
298+
open correctly, and saving writes UTF-8 with a byte-order mark that Excel reads without a wizard.
283299
</p>
284300
<h3>Does the converter work offline?</h3>
285301
<p>Yes. Once loaded it is an installable PWA, so it keeps working with no internet connection.</p>

‎public/zh-CN/convert/csv-to-xlsx.html‎

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<title>在浏览器中把 CSV 转成 XLSX——免费、不传服务器</title>
1313
<meta
1414
name="description"
15-
content="完全在浏览器中把 CSV 文件转成 XLSX(Excel)——打开后导出为 XLSX。免费、开源、文件留在本地、支持离线。无需 Excel,也无需账号。"
15+
content="完全在浏览器中把 CSV 文件转成 XLSX(Excel)——自动识别 GBK/GB18030 编码,中文 CSV 不再乱码。免费、开源、文件留在本地、支持离线。无需 Excel,也无需账号。"
1616
/>
1717
<link rel="canonical" href="https://edit.chaxus.com/zh-CN/convert/csv-to-xlsx" />
1818
<link rel="alternate" hreflang="en" href="https://edit.chaxus.com/convert/csv-to-xlsx" />
@@ -99,7 +99,15 @@
9999
"name": "它期望什么分隔符和编码?",
100100
"acceptedAnswer": {
101101
"@type": "Answer",
102-
"text": "它默认使用标准的逗号分隔值;如果你的文件需要,OnlyOffice 的导入步骤允许你选择不同的分隔符或文本编码。"
102+
"text": "逗号、分号、制表符自动识别;编码同样自动嗅探:UTF-8(有无 BOM 皆可)、GB18030 / GBK、最后 Latin-1。"
103+
}
104+
},
105+
{
106+
"@type": "Question",
107+
"name": "中文 CSV 在别的工具里乱码,这里会吗?",
108+
"acceptedAnswer": {
109+
"@type": "Answer",
110+
"text": "通常不会。乱码是文件用 GBK / GB18030 保存却被当作 UTF-8 读的结果;这里先嗅探字节再解码,Excel 导出的中文 CSV 能正常打开,保存时写入带 BOM 的 UTF-8,Excel 直接打开不乱码。"
103111
}
104112
},
105113
{
@@ -245,6 +253,15 @@ <h2>如何操作</h2>
245253
XLSX 之前写入公式——而且全程不会把数据上传到任何地方。这是让机器生成的导出变得美观易读的快捷方式。
246254
</p>
247255

256+
<h2>为什么别的工具打开中文 CSV 会乱码</h2>
257+
<p>
258+
乱码几乎总是编码问题:Excel"另存为 CSV"默认用系统代码页(简体中文系统是 GBK / GB18030,也就是 Excel
259+
里写的"ANSI"),而多数网页工具、macOS 数据编辑器和程序库一律按 UTF-8 读,于是"客户名称"变成一串"锟斤拷"。
260+
反过来,带 UTF-8 BOM 的文件在旧版 Excel 里又会把 BOM 当成内容。这个转换器在打开前先嗅探字节:先按严格 UTF-8
261+
解码,失败再按 GB18030,最后 Latin-1 兜底;分隔符(逗号、分号、制表符)同样自动识别。保存回 CSV 时写入带 BOM 的
262+
UTF-8,Excel 双击打开不再乱码。整个过程在你的浏览器里完成,文件不上传。
263+
</p>
264+
248265
<r-card class="oss"
249266
><div class="card-body">
250267
<strong>开源且可自托管。</strong> 基于 AGPL-3.0 协议——你可以核实文件确实没有被上传,或者运行你自己的副本:
@@ -265,7 +282,12 @@ <h3>我需要 Excel 或账号吗?</h3>
265282
<h3>数字和日期列会被识别吗?</h3>
266283
<p>CSV 会变成一个真正的表格,因此你可以在保存为 XLSX 之前设置数字、日期和文本单元格格式。</p>
267284
<h3>它期望什么分隔符和编码?</h3>
268-
<p>默认使用标准的逗号分隔值;导入步骤允许你选择不同的分隔符或文本编码。</p>
285+
<p>逗号、分号、制表符自动识别;编码同样自动嗅探:UTF-8(有无 BOM 皆可)、GB18030 / GBK、最后 Latin-1。</p>
286+
<h3>中文 CSV 在别的工具里乱码,这里会吗?</h3>
287+
<p>
288+
通常不会。乱码是文件用 GBK / GB18030 保存却被当作 UTF-8 读的结果;这里先嗅探字节再解码,Excel 导出的中文 CSV
289+
能正常打开,保存时写入带 BOM 的 UTF-8,Excel 直接打开不乱码。
290+
</p>
269291
<h3>这个转换器能离线使用吗?</h3>
270292
<p>可以。加载后它就是一个可安装的 PWA,因此在没有网络时依然可用。</p>
271293
</div>

0 commit comments

Comments
 (0)