乱码是怎么来的Where Garbled Text Comes From
同一个中文字,在不同编码里占用的字节不同。比如"你好"用 UTF-8 存是 6 个字节,用 GBK 存是 4 个字节。如果你用 UTF-8 的方式去读一个 GBK 文件,字节对不上,就会显示出"浣犲ソ""ÖÂ"或一堆黑色方块(¬¬¬)。
The same Chinese character occupies different bytes under different encodings. "你好" is 6 bytes in UTF-8 but 4 bytes in GBK. If you read a GBK file as UTF-8, the bytes don't line up and you see "浣犲ソ", "ÖÂ" or black blocks (¬¬¬).
判断诀窍:中文 Windows 导出的 CSV 多半是 GBK/GB2312;网页或 Mac 导出多是 UTF-8;繁体常是 Big5;日文常见 Shift_JIS。知道来源,就能选对编码。
Quick clue: CSVs exported from Chinese Windows are usually GBK/GB2312; web or Mac exports tend to be UTF-8; traditional Chinese is often Big5; Japanese is commonly Shift_JIS. Knowing the source helps you pick the right encoding.
用 365Lab 一键修复(无需安装)One-Click Fix with 365Lab (No Install)
- 打开 编码转换 模块。
- 上传文件,点击「自动检测」,工具会尝试识别 GBK / Big5 / Shift_JIS / EUC-KR 等编码并正确显示。
- 确认内容正常后,把目标编码设为
UTF-8,点击导出下载。 - 之后再用 Excel / 365Lab 解析,就再也不会乱码了。
- Open the Encoding module.
- Upload the file and click "Auto-detect" — it tries to identify GBK / Big5 / Shift_JIS / EUC-KR and display correctly.
- Once the content looks right, set the target encoding to
UTF-8and export to download. - Open it again in Excel / 365Lab and the garbling is gone for good.
常见乱码场景对照Common Garble Scenarios
| 你看到的What you see | 通常原因Likely cause | 正确编码Right encoding |
|---|---|---|
| 浣犲ソ / 鍟婂ソ浣犲ソ / 鍟婂ソ | GBK 被当成 UTF-8GBK read as UTF-8 | GBKGBK |
| ÖÂ / ÃèÖÂ / Ãè | UTF-8 被当成 GBK/Latin-1UTF-8 read as GBK/Latin-1 | UTF-8UTF-8 |
| ????? / 黑色方块????? / black blocks | 编码完全不匹配Totally mismatched encoding | 需检测原编码Detect the original |
如何避免以后再乱码How to Avoid It Next Time
- 统一用 UTF-8:导出和保存时优先选择 UTF-8(带 BOM 与否视对方系统而定)。
- 跨系统先转码:从 Windows 拿到 GBK 文件,先转成 UTF-8 再传给 Mac/Linux 伙伴。
- 让工具自动识别:365Lab 解析页支持自动编码检测,省去手动猜测。
- Standardize on UTF-8: prefer UTF-8 when exporting and saving (BOM or not depends on the receiving system).
- Transcode before crossing systems: if you get a GBK file from Windows, convert it to UTF-8 before sending it to a Mac/Linux friend.
- Let the tool detect: 365Lab's Parse page auto-detects encoding so you don't guess.