在Excel中打开包含特殊字符的.csv文件 [英] Open .csv file containing special characters in Excel

查看:171
本文介绍了在Excel中打开包含特殊字符的.csv文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个导出.csv文件的系统,其中一些行包含特殊的字符,使数据如下所示:

 请指定您提出的主要机会类型:
└─请指定什么类型的运动:
└─这个人的职业是什么?
└──他们在行业里有多长时间?

但是,当我打开Excel中的文件时,Excel会扭曲框字符,使其最终看起来如下所示:

 请指定您提出的主要机会类型:
ââ €请指定什么类型的运动:
ââ€这个人的职业是什么?
ââ€â€他们在行业里有多长时间?

该文件被保存为用户的硬盘驱动器的纯文本,我可以打开它一个文本编辑器,看到字符很好,所以我知道这是Excel读入数据时发生的事情。



任何想法?如何防止这种情况?

解决方案

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

I have a system that exports a .csv file and some of the rows contain special box characters such that the data looks like this:

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?

However, when I open the file in excel, Excel warps the box characters so that it ends up looking like this:

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?  

The file is being saved as plain-text to the user's hard drive, and I can open it in a text editor and see the characters fine, so I know it's something happening when Excel reads in the data.

Any thoughts? How can I prevent this?

解决方案

In a PHP generated CSV I solved it with utf8_decode() for the concerning columns.

这篇关于在Excel中打开包含特殊字符的.csv文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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