源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

ASP让url的中文显示为编码

  • 时间:2021-09-02 01:04 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:ASP让url的中文显示为编码
asp解码url
[u]复制代码[/u] 代码如下:
<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]
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部