【问题标题】:Open .csv file containing special characters in Excel在 Excel 中打开包含特殊字符的 .csv 文件
【发布时间】:2009-02-09 18:30:17
【问题描述】:

我有一个导出 .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 读取数据时会发生这种情况。

有什么想法吗?我怎样才能防止这种情况发生?

【问题讨论】:

    标签: excel text


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

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

      问候, 库尔迪普·拉索德

      【讨论】:

        【解决方案3】:

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

        如果可能,请选择 UTF

        HTH

        【讨论】:

          猜你喜欢
          • 2020-11-26
          • 1970-01-01
          • 1970-01-01
          • 2020-08-28
          • 2021-01-09
          • 2017-03-10
          • 2016-11-10
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多