asp utf-8转码函数
如果asp接收来自UTF-8页面的表单,即表单以UTF-8方式发送,但ASP脚本为gb2312编码代码页,那么可以使用此函数进行转码。此函数同时也适用于asp下UTF-8转换GB2312
<%
Function 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接收来自UTF-8页面的表单,即表单以UTF-8方式发送,但ASP脚本为gb2312编码代码页,那么可以使用此函数进行转码。此函数同时也适用于asp下UTF-8转换GB2312
<%
Function 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
%>
作者:noel@淘宝网女装新款秋装连衣裙裤子外套上衣_2012时尚女装新款 Ecmall二次开发-PHP技术
地址:http://www.laohucheng.com/post/328/
版权所有©转载时必须以链接形式注明作者和原始出处及本声明!
Tags: asp-utf-8转码函数 引用(0)
ASP连接11种数据库语法
css+js实现排行、滑动切换的新闻列表
2009
16:30
662
0


