Microsoft Excel mangles Diacritics in .csv files?

后端 未结 22 1715
粉色の甜心
粉色の甜心 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:20

    As Fregal said \uFEFF is the way to go.

    <%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%>
    <%
    Response.Clear();
    Response.ContentType = "text/csv";
    Response.Charset = "utf-8";
    Response.AddHeader("Content-Disposition", "attachment; filename=excelTest.csv");
    Response.Write("\uFEFF");
    // csv text here
    %>
    

提交回复
热议问题