使用server.urlencode后的问题

使用server.urlencode后的问题

我用server.urlencode函数将地址“http://www.163.com/你好啊!”转换成了http%3A%2F%2Fwww%2E163%2Ecom%2F%C4%E3%BA%C3%B0%A1%A3%A1
但是怎么转换回来呢?而且要在页面上输出。
我想在ASP页面中实现。
谢谢!

server.urlencode解码函数
[转载]

Function URLDecode(enStr)
dim deStr,strSpecial
dim c,i,v
deStr=""
strSpecial="!""#$%&'()*+,.-_/:;<=>?@[\]^`{|}~%"
for i=1 to len(enStr)
c=Mid(enStr,i,1)
if c="%" then
v=eval("&h"+Mid(enStr,i+1,2))
if inStr(strSpecial,chr(v))>0 then
deStr=deStr&chr(v)
i=i+2
else
v=eval("&h"+ Mid(enStr,i+1,2) + Mid(enStr,i+4,2))
deStr=deStr & chr(v)
i=i+5
end if
else
if c="+" then
deStr=deStr&" "
else
deStr=deStr&c
end if
end if
next
URLDecode=deStr
End function
温馨提示:答案为网友推荐,仅供参考
相似回答