永发信息网

Asp中如何将unicode转换成gb2312

答案:1  悬赏:20  手机版
解决时间 2021-01-23 04:28
  • 提问者网友:却不属于对方
  • 2021-01-22 18:53
Asp中如何将unicode转换成gb2312
最佳答案
  • 五星知识达人网友:归鹤鸣
  • 2021-01-22 19:04
<%
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("暗暗")
%>
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯