When exporting SQL Server data to .csv
, phrases in Persian don't show up correctly.
string date = Helper.ToPersianDate(DateTime.Now).Replace("/", "");
date += ".csv";
Response.Clear();
Response.AppendHeader("content-disposition", "attachment; filename=" + date);
Response.ContentType = "text/csv";
Response.Charset = Encoding.Unicode.ToString();
foreach (DataRow r in ds.Tables[0].Rows)
{
Response.Write(r[0]);
Response.Write("\r\n");
}
Response.End();