开发语言:C#
IE8下载时木有问题的,就IE6会有这个情况。
下载代码片段:
var gb2312 = Encoding.GetEncoding("gb2312");
fileName = gb2312.GetString(Encoding.Convert(Encoding.Unicode, gb2312, Encoding.Unicode.GetBytes(fileName)));
Response.HeaderEncoding = Encoding.GetEncoding("gb2312");
Response.Clear();
Response.ClearHeaders();
Response.Buffer = false;
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
Response.AddHeader("Content-Length", (dataToRead - p).ToString());
iStream.Position = p;
dataToRead = dataToRead - p;
IE6 下载文件时,下载对话框标题乱码
= =彪悍!小学生表示震惊了!
自己已经解决。