asp解码url
复制代码 代码如下:
复制代码
<a href="1.asp?action=<%=server.urlencode("你好")%>">asdf</a>
<a href="1.asp?action=<%=server.urlencode("你好")%>">asdf</a>
解码函数
[code]
<%
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
response.Write URLDecode(request.QueryString("action"))
%>
[html]
最后
以上就是优雅外套最近收集整理的关于ASP让url的中文显示为编码的全部内容,更多相关ASP让url内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复