如何修复CSV文件中的无效字符显示? [英] How can I fix the invalid character display in CSV files?

查看:161
本文介绍了如何修复CSV文件中的无效字符显示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从.xslx文件创建.csv文件。我正在通过将每个标签保存为.csv来进行操作。在标签的一个单元格中,有一个字符串'InH₂O'。当我为此选项卡创建.csv文件时,上面的字符串在csv文件中写为'InH?O'。我怎样才能解决这个问题?我想创建一个csv文件,其值在xlsx文件中。感谢任何帮助。

I need to create .csv files from an .xslx file. I am doing it manuall, by saving each tab as .csv. In one of the cells in a tab, there is a string 'InH₂O'. When I create .csv file for this tab, the above string is written in the csv file as 'InH?O'. How can I fix this? I would like to create a csv file having values which is in the xlsx file as it is. Appreciate any help.

推荐答案

它只是意味着H 2O使用其中一个UTF(下标代码点U + 2082,下标2)并且您在其中一个非Unicode 编码中编写了Unicode字符串,例如ASCII。您获得的问号是在尝试使用原始Unicode字符串时使用某些旧版编码序列化不支持字符库中的某些字符时使用的常用后备字符。 />


解决方案是在其中一个UTF编码中写入输出CSV文件;通常最常用的持久存储UTF-8。更多细节取决于您未与我们分享的平台和语言。如果你解释了所有相关的细节,你可以得到进一步的帮助,如果你需要的话。



-SA
It simply means that the H₂O was stored in the database as Unicode, using one of the UTFs (the subscript code point U+2082, "subscript two") and you wrote the Unicode string in one of the non-Unicode encodings, such as ASCII. The question mark you got is the usual "fallback" character used when the Unicode string is attempted serialize in some legacy encoding not supporting some of the characters of the character repertoire using in the original Unicode string.

The solution is to write output CSV file in one of the UTF encodings; usually the most practical for persistent storage UTF-8 is used. Further detail depends on your platform and language which you did not share with us. If you explain all the relevant detail, you could get further help, if you need it.

—SA


这篇关于如何修复CSV文件中的无效字符显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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