查看文章
 
asp request utf-8转码函数 解决乱码问题
2009-10-08 18:13

原文地址:http://www.msphome.cn/post/75/
asp request utf-8
转码函数

如果asp接收来自UTF-8页面的表单,即表单以UTF-8方式发送,但ASP脚本为gb2312编码代码页,那么可以使用此函数进行转码。此函数同时也适用于aspUTF-8转换

GB2312Function utf2gb(Body)
Dim Objstream
Set Objstream = Server.CreateObject("adodb.stream")
objstream.Charset = "gb2312"
objstream.Type = 2
objstream.Mode =3
objstream.Open
objstream.WriteText body
objstream.Position = 0
objstream.Charset = "utf-8"
objstream.Type = 2
utf2gb = objstream.ReadText
objstream.Close
set objstream = nothing
End Function


类别:asp建站||添加到搜藏 |分享到i贴吧|浏览(572)|评论 (0)
 
 
最近读者:
 
网友评论:
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
     

   
帮助中心 | 空间客服 | 投诉中心 | 空间协议
©2012 Baidu