哪种编码可以在 Mac 和 Windows 上使用 Excel 正确打开 CSV 文件?-开发者之家

您所在的位置:网站首页 csv编码格式转换 哪种编码可以在 Mac 和 Windows 上使用 Excel 正确打开 CSV 文件?-开发者之家

哪种编码可以在 Mac 和 Windows 上使用 Excel 正确打开 CSV 文件?-开发者之家

2023-03-29 18:51| 来源: 网络整理| 查看: 265

问题描述

我们有一个网络应用程序,可以导出包含 UTF-8 外来字符的 CSV 文件,没有 BOM.Windows 和 Mac 用户都会在 Excel 中获得垃圾字符.我尝试使用 BOM 转换为 UTF-8;Excel/Win 很好用,Excel/Mac 显示乱码.我使用的是 Excel 2003/Win、Excel 2011/Mac.这是我尝试过的所有编码:

We have a web app that exports CSV files containing foreign characters with UTF-8, no BOM. Both Windows and Mac users get garbage characters in Excel. I tried converting to UTF-8 with BOM; Excel/Win is fine with it, Excel/Mac shows gibberish. I'm using Excel 2003/Win, Excel 2011/Mac. Here's all the encodings I tried:

Encoding BOM Win Mac -------- --- ---------------------------- ------------ utf-8 -- scrambled scrambled utf-8 BOM WORKS scrambled utf-16 -- file not recognized file not recognized utf-16 BOM file not recognized Chinese gibberish utf-16LE -- file not recognized file not recognized utf-16LE BOM characters OK, same as Win row data all in first field

最好的是带有 BOM 的 UTF-16LE,但 CSV 不被识别.字段分隔符是逗号,但分号不会改变.

The best one is UTF-16LE with BOM, but the CSV is not recognized as such. The field separator is comma, but semicolon doesn't change things.

是否有任何编码可以同时适用于两个世界?

推荐答案

内幕是:没有解决方案.无论您使用何种编码或跳圈,Excel 2011/Mac 都无法正确解释包含变音符号和变音符号的 CSV 文件.我很高兴听到有人告诉我不同​​!

The lowdown is: There is no solution. Excel 2011/Mac cannot correctly interpret a CSV file containing umlauts and diacritical marks no matter what encoding or hoop jumping you do. I'd be glad to hear someone tell me different!



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3