I’m using this code to export data from a repeater to an Excel sheet:
Response.ContentType = "application/vnd.ms-excel";
Response.Charset = "";
this.EnableViewState = false;
System.IO.StringWriter oStringWriter = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);
Excel sheet when is displayed contains data from repeater, notwithstanding accents and Spanish letter ñ containing within data are not drawing correctly, e.g.:
México it is drawing as MÃ©xico
López it is drawing as LÃ³pez
Villafaña it is drawing as VillafaÃ±a
María it is drawing as MarÃa
¿Does somebody knows what is the reason about it and how can I fix it?
I’ll appreciate your help.
El Hombre que tiene Amigos ha de mostrarse Amigo