下载采用 utf-8 编码的 CSV 文件
我们有一个 Web 应用程序,可以存储和处理字符编码为 UTF-8 的数据。
当我打开从系统导出的 CSV 文件时,我遇到了麻烦,因为某些程序会将 CSV 解释为不同的字符编码,并且开始出现有趣的符号。
我尝试发送 http://en.wikipedia.org/wiki/Byte_order_mark#UTF -8 但 OpenOffice 似乎并不尊重这一点。
有没有办法强制文件采用UTF-8编码?
我可以将文件保留为 UTF-8,并依靠我们的用户来对其进行排序 - 但是我们的用户不会特别懂技术,所以我不确定这是否明智。
更安全的方法是在导出之前将数据转换为基本字符集吗?
We have a web app that stores and works with data with character encoding UTF-8.
When I open a CSV file exported from our system, I run into trouble as some programs will interpret the CSV as a different character encoding and funny symbols start to appear.
I've tried sending a http://en.wikipedia.org/wiki/Byte_order_mark#UTF-8 but OpenOffice doesn't seem to respect that.
Is there a way to force the file to be in UTF-8 encoding?
I could leave the file in UTF-8 and rely on our users to sort it out - however our users will not be particularly technical so I'm not sure this is wise.
Would a safer approach just be to convert the data to a basic character set before exporting?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
前段时间我们也遇到过类似的问题。适用于所有应用程序的解决方案是发送带有 BOM 的 UTF-16LE 编码数据。
We had a similar problem some time ago. The solution that worked for all applications was to send UTF-16LE encoded data with BOM.