欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

ASP讓url的中文顯示為編碼

 更新時間:2011年02月27日 15:26:33   作者:  
有時候傳遞中文會出現(xiàn)亂碼等原因,最好對中文參數(shù)進行編碼處理。
asp解碼url
復(fù)制代碼 代碼如下:

<a href="1.asp?action=<%=server.urlencode("你好")%>">asdf</a>

解碼函數(shù)
[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]

相關(guān)文章

最新評論