下载的文件中有中文就乱码

漠叔 2009-09-05 10:41:55

<%
s = "中文"

With Response
.Charset = "GB2312"
.ContentType= "application/octec-stream"
.AddHeader "Accept-Ranges", "bytes"
.AddHeader "Content-Length", LenB(s)
.AddHeader "Content-Type", "application/octec-stream"
.AddHeader "DownloadOptions", "noopen"
.AddHeader "Content-Disposition","attachment; filename=test.txt"
.BinaryWrite s
End With

%>

下载的文件text.txt中是乱码,如果"中文"是英文字母和数字就正常
...全文
63 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
漠叔 2009-09-06
  • 打赏
  • 举报
回复
请问楼上byte2str函数的具体代码是?
toury 2009-09-05
  • 打赏
  • 举报
回复
google: byte2str()
用这个函数处理你的s

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧