我在导出的excel中其他的都是正常的只有列头部分是乱码,我应该如何处理呢?各位帮忙!
我是这样处理的:
   Response.Buffer = true;
            Response.Charset = "utf-8";
            Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode("Excel.xls", System.Text.Encoding.GetEncoding("GB2312")));
                   Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
            Response.ContentType = "application/ms-excel";//设置输出文件类型为excel文件。 
            System.IO.StringWriter oStringWriter = new System.IO.StringWriter();
            System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);
            this.GridView1.RenderControl(oHtmlTextWriter);
            Response.Write("<meta   http-equiv=Content-Type   content=text/html;charset=GB2312>");
            Response.Output.Write(oStringWriter.ToString());
            Response.Flush();
            Response.End();