我有一个系统导出.csv文件,一些行包含特殊的框字符,使得数据如下所示:
Please specify the primary type of opportunity which you’re proposing:
?? Please specify what type of sport:
?? What is this person’s vocation?
??? How long have they been in the industry?
Run Code Online (Sandbox Code Playgroud)
但是,当我在Excel中打开文件时,Excel会对框中的字符进行扭曲,使其最终看起来像这样:
Please specify the primary type of opportunity which you’re proposing:
└─ Please specify what type of sport:
└─ What is this person’s vocation?
└── How long have they been in the industry?
Run Code Online (Sandbox Code Playgroud)
该文件以纯文本形式保存到用户的硬盘中,我可以在文本编辑器中打开它并查看字符,所以我知道当Excel读入数据时会发生这种情况.
有什么想法吗?我怎么能阻止这个?
excel 可能尝试使用错误的编码打开文件;尝试从 Excel 中打开文件,并选择不同的文件编码;这些可能是 Unicode 字符,Excel 可能使用 iso-8859-15 进行导入。
如果可能的话选择UTF
华泰