打开包含Excel中特殊字符的.csv文件

时间:2009-02-09 18:30:17

标签: excel text

我有一个导出.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?

但是,当我在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?  

文件以纯文本格式保存到用户的硬盘中,我可以在文本编辑器中打开它,看到字符很好,所以我知道当Excel读入数据时会发生这种情况。

有什么想法?我该如何防止这种情况?

3 个答案:

答案 0 :(得分:5)

在PHP生成的CSV中,我使用utf8_decode()解决了相关列。

答案 1 :(得分:3)

导入您的csv文件,如Excel 2007中的链接所示。 选择适当的编码,结果将显示包含特殊字符的预期数据。 http://www.howtogeek.com/howto/microsoft-office/import-text-into-excel-2007/

此致 Kuldeep Rathod

答案 2 :(得分:2)

excel可能正在尝试使用错误的编码打开文件;尝试从Excel中打开文件,并选择不同的文件编码;这些可能是Unicode字符,Excel可能正在使用iso-8859-15导入。

如果可能,请选择UTF

HTH

相关问题