Microsoft Excel mangles Diacritics in .csv files?

后端 未结 22 2214
粉色の甜心
粉色の甜心 2020-11-22 05:02

I am programmatically exporting data (using PHP 5.2) into a .csv test file.
Example data: Numéro 1 (note the accented e). The data is utf-8 (

22条回答
  •  自闭症患者
    2020-11-22 05:23

    The answer for all combinations of Excel versions (2003 + 2007) and file types

    Most other answers here concern their Excel version only and will not necessarily help you, because their answer just might not be true for your version of Excel.

    For example, adding the BOM character introduces problems with automatic column separator recognition, but not with every Excel version.

    There are 3 variables that determines if it works in most Excel versions:

    • Encoding
    • BOM character presence
    • Cell separator

    Somebody stoic at SAP tried every combination and reported the outcome. End result? Use UTF16le with BOM and tab character as separator to have it work in most Excel versions.

    You don't believe me? I wouldn't either, but read here and weep: http://wiki.sdn.sap.com/wiki/display/ABAP/CSV+tests+of+encoding+and+column+separator

提交回复
热议问题