以CSV格式导出后显示未知字符 [英] Showing unknown characters after exporting in CSV

查看:89
本文介绍了以CSV格式导出后显示未知字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

显示

CHRIS MORRIS˜



的门户网站数据,但将数据导出为CSV后显示为


but after Exporting data into CSV It showing like

CHRIS MORRIS˜



除此之外如果导出到excel数据导出与门户网站相同。



提前致谢



我尝试过:



使用ExtJs 2.3和C#。

我需要做的就是导出正确的数据,就像在门户网站上显示一样。


apart from that if exporting into excel data exports as same as on portal.

Thanks in advance

What I have tried:

Using ExtJs 2.3 and C#.
What I have to do for export correct data as same as showing on portal.

推荐答案

这取决于你的CSV生成器使用的字符编码和用于显示CSV文件内容的工具 - 在您的情况下 - 可能没有检测或支持文件的编码。



ANSI(Windows 1252)字符Ëœ具有十六进制代码CB 9C,它是〜字符的UTF-8序列(Unicode代码点U + 02DC)。



所以它看起来像你的CSV生成器创建一个UTF-8编码的文件(这是常见的),但你的工具来查看t他的文件内容采用ANSI编码。



如果一切按预期工作,则无事可做。要正确查看内容,请使用能够检测UTF-8编码的编辑器打开文件,或者提供指定编码的选项。一个例子是 Notepad ++ 编辑器(不是Windows 记事本)。
It depends on the character encoding used by your CSV generator and the tool used to display the CSV file content which - in your case - probably did not detect or support the encoding of the file.

The ANSI (Windows 1252) characters "˜" have the hex codes CB 9C which is the UTF-8 sequence for the ~ character (Unicode code point U+02DC).

So it looks like your CSV generator creates an UTF-8 encoded file (which is common) but your "tool" to view the file content assumes ANSI encoding.

There is nothing to do if everything is working as expected. To view the content correctly, open the file with an editor that is able to detect the UTF-8 encoding or provides an option to specify the encoding. An example is the Notepad++ editor (that is not the Windows Notepad).


这篇关于以CSV格式导出后显示未知字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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