Here is my code for initiating download
System.Web.HttpContext.Current.Response.ClearContent();
System.Web.HttpContext.Current.Response.Charset = "utf-8";
System.Web.HttpContext.Current.Response.HeaderEncoding = UnicodeEncoding.UTF8;
System.Web.HttpContext.Current.Response.ContentEncoding = UnicodeEncoding.UTF8;
//System.Web.HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.UTF8;
System.Web.HttpContext.Current.Response.AddHeader("Content-Type", "text/csv");
System.Web.HttpContext.Current.Response.AddHeader("Cache-Control", "max-age=0");
System.Web.HttpContext.Current.Response.AddHeader("Accept-Ranges", "none");
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment" + "; filename=Data.csv");
System.Web.HttpContext.Current.Response.BinaryWrite(buffer);
System.Web.HttpContext.Current.ApplicationInstance.CompleteRequest();
System.Web.HttpContext.Current.Response.Flush();
System.Web.HttpContext.Current.Response.Close();
args.AbortPipeline();
the out csv file contains like this at the place of some arabic letters
Data 99999;Arabic: ?????????????? ?????????????? al-abj;jkj;biluruya@mswork.ru;
I dont know why the UTF-8 encoding is not working here or is my download code wrong . could some one pls explain me the issue here ?
Thanks