使用以下代码,我将GridView输出到Microsoft Word(通过HTML)
Response.Clear()
Response.Buffer = True
Response.AddHeader("content-disposition", "attachment;filename=" & CountryName & ".doc")
Response.Charset = ""
Response.ContentType = "application/vnd.ms-word "
Dim sw As StringWriter = New StringWriter()
Dim hw As HtmlTextWriter = New HtmlTextWriter(sw)
gridview1.AllowPaging = False
gridview1.DataBind()
gridview1.RenderControl(hw)
Response.Output.Write(sw.ToString())
Response.Flush()
Response.[End]()
但是它包含诸如É
之类的字符,因此将其更改为É
这是编码问题吗?如果是这样,如何更改编码以支持这些字符?