哪种编码可以在 Mac 和 Windows 上使用 Excel 正确打开 CSV 文件? [英] Which encoding opens CSV files correctly with Excel on both Mac and Windows?

查看:25
本文介绍了哪种编码可以在 Mac 和 Windows 上使用 Excel 正确打开 CSV 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个网络应用程序,可以导出包含 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!

这篇关于哪种编码可以在 Mac 和 Windows 上使用 Excel 正确打开 CSV 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆