壹次网首页 | 工具源码首页 | 技术文章首页 | 文章分类 | | |

文章搜索: 分类 关键字
您的位置:首页网络编程ASP/shtml → ASP中转换unicode码为GB码函数
ASP中转换unicode码为GB码函数
添加日期:2007-6-11 3:40:52     [ ]

<%
function urldecode(encodestr)

newstr=""
havechar=false
lastchar=""
for i=1 to len(encodestr)
char_c=mid(encodestr,i,1)
if char_c="+" then
newstr=newstr & " "
elseif char_c="%" then
next_1_c=mid(encodestr,i+1,2)
next_1_num=cint("&H" & next_1_c)

if havechar then
havechar=false
newstr=newstr & chr(cint("&H" & lastchar & next_1_c))
else
if abs(next_1_num)<=127 then
newstr=newstr & chr(next_1_num)
else
havechar=true
lastchar=next_1_c
end if
end if
i=i+2
else
newstr=newstr & char_c
end if

next
urldecode=newstr
end function


response.write urldecode("%B0%B5%B0%B5")
response.write Server.URLEncode("暗暗")
%>

出处:论坛转载 作者:佚名 点击:
 相关文章
·UTF-8 and Unicode FAQ
 热点文章
·photoshop制作香烟、烟头、烟雾
·photoshop图片卷角、翻页效果的制作
·用U盘或移动硬盘装《深山红叶袖珍系统Win PE启动..
·photoshop经典恐怖片海报效果教程
·ghost.pif最新变种手动查杀,ARP欺骗挂马+KAV让..
·photoshop制作3D立体小人和字体
·photoshop水晶球质感表现 - 关于光影的细节
·关于zend解密的程序
·王晨昀:谁来拯救中小网站?
·photoshop泛黄、陈旧纸张效果的制作
 推荐文章
·如何彻底删除一个不需要的系统服务
·模仿QQ和MSN消息提示的效果
·CC攻击的思路及防范方法
·广告联盟的一些评价
Powered by yici.net
CopyRight (C) 2006-2012 版权所有   [ 依次网 ];未经授权,任何人不得抄袭、仿冒本站
ICP备案:苏ICP备05011771号 证书下载 ICP证号:苏ICP证040301
仪征广目网络信息服务有限公司 版权所有