首页
技术库|站长工具|技术手册|字体库|知识点词汇表| 联系我们|
打开本页的html静态页面
 

主菜单

文章分类

.: Asp技术 .: Asp问题集锦 .: ASP中如何将unicode编码转为为gb2312编码(代码实现)

  • 全文内容
  • 发表评论
  • 文章点评
  • 文章附件
  • Email文章
  • 打印文章

ASP中如何将unicode编码转为为gb2312编码(代码实现)

点击次数:320 创建日期:12-13-2007 录入:cn-web.com 字体:[ ] 点评:


ASP中如何将unicode编码转为为gb2312编码(代码实现)

<%
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("暗暗")
%>

请文明参与讨论,禁止漫骂攻击。
评论总数:0 [ 查看全部 ] 网友评论
此文章还没有任何评论!
(+5分)
(+4分)
(+3分)
(+2分)
(+1分)
此内容无附件
网站地图 - 知识词汇 - 全文检索 - 广告服务 - 帮助中心 - 联系我们
.:www.cn-web.com
网站技术开发联盟之WEB开发技术知识库
联系人:老韩(QQ:5679551)
晋ICP备07003487号