asp生成HTML编码问题求助
时间:2011-11-23
来源:互联网
C# code
以上代码生成静态HTML文件之后 该文件用编辑器打开 显示Unicode编码 请问有什么方法解决?详解 谢谢
<%@ codepage=65001%> <% Response.Charset="UTF-8" %> <% function getHTTPPage(url) dim Http set http=Server.createobject("MSXML2.ServerXMLHTTP") Http.setTimeouts 10000,10000,10000,30000 Http.open "GET",url,false Http.send() if Http.readystate<>4 then exit function end if getHTTPPage=bytesToBSTR(Http.responseBody,"utf-8") set http=nothing if err.number<>0 then err.Clear end function Function BytesToBstr(body,Cset) dim objstream set objstream = Server.CreateObject("adodb.stream") objstream.Type = 1 objstream.Mode =3 objstream.Open objstream.Write body objstream.Position = 0 objstream.Type = 2 objstream.Charset = Cset BytesToBstr = objstream.ReadText objstream.Close set objstream = nothing End Function Dim Url,Html Url="http://www.url.com/" Html = getHTTPPage(Url) dim filename,fso,fout filename="index.htm" Set fso = Server.CreateObject("Scripting.FileSystemObject") Set fout = fso.CreateTextFile(server.mappath(""&filename&""), True, True) 'Set fout = fso.CreateTextFile(server.mappath(""&filename&"")) fout.Write Html fout.close set fout=nothing set fso=nothing if err then response.Write("生成页面失败") else response.Write("<a href='/index.htm' target='_blank'>生成页面成功</a>") end if %>
以上代码生成静态HTML文件之后 该文件用编辑器打开 显示Unicode编码 请问有什么方法解决?详解 谢谢
作者: cckakaok 发布时间: 2011-11-23
自己顶下
作者: cckakaok 发布时间: 2011-11-24
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28