CSV-File with sepcial characters RRS feed

  • Question

  • User1452071630 posted
    Hello, I like to offer a posibility to download a CSV-Textfile at a webpage. The download data is only available as a string and not as a file (so I can't use somethin like FileStream). I tried different way's but im my downloaded file the special characters are replaced with two chars like 'ü' (means ü) -> 'ü'. Is there a solution out there? aspx-File: ... Context.Response.Clear(); Context.Response.BufferOutput = true; Context.Response.AddHeader("Content-Disposition", "attachment; filename=test_BM.csv"); Context.Response.ContentType = "text/comma-separated-values"; //Context.Response.ContentType = "application/octet-stream"; Context.Response.Charset = "iso-8859-1"; strExportLine = "test äöüß test"; Context.Response.Output.Write(strExportLine + Environment.NewLine); Context.Response.Flush(); ... Web.config: <globalization requestEncoding="utf-8" responseEncoding="utf-8" fileEncoding="ISO-8859-1" culture="de-DE" uiCulture="de-DE"/> Thanks Andreas
    Tuesday, November 16, 2004 11:41 AM

All replies

  • User1452071630 posted
    Hi all, I got a solution. Context.Response.ContentEncoding = System.Text.Encoding.GetEncoding( "iso-8859-1" ); Maybe someone needs this too. Andreas
    Monday, November 22, 2004 6:22 AM