I am using Memory-stream to write my data into Excel (used Unicode8F),however i have some HINDI language characters in it as well.
After doing export to excel using C#,when I try to open up the exported excel in MS Excel 2010,the Hindi words are appearing in some roman characters.
Please help.
Do we need to make some change in the C# code or Do some setting in the Excel 2010 ?
Source code –
byte[] bytesToSend = System.Text.Encoding.UTF8.GetBytes(partialtorender);
System.IO.MemoryStream memStr = new System.IO.MemoryStream();
memStr.Write(bytesToSend, 0, bytesToSend.Length);
memStr.Position = 0;
FileStreamResult result1 = new FileStreamResult(memStr, "application/ms-excel");
Response.AddHeader("content-disposition", "attachment; filename=" + "newExcelSheet" + ".xls");
return result1;
I replaced my code for Excel generation with this and it did wonders.