这串怎么好像是繁体字啊??
试试下面这个函数把。
<%
'*********字符编码转换***********************
function URLDecode(enStr)
dim deStr,strSpecial
dim c,i,v
if enStr="" or isnull(enStr) then exit function
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("%E8%8D%89%E7")
response.write Server.URLEncode("我是中国人")
response.write URLDecode(Server.URLEncode("我是中国人"))
%>
试试下面这个函数把。
<%
'*********字符编码转换***********************
function URLDecode(enStr)
dim deStr,strSpecial
dim c,i,v
if enStr="" or isnull(enStr) then exit function
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("%E8%8D%89%E7")
response.write Server.URLEncode("我是中国人")
response.write URLDecode(Server.URLEncode("我是中国人"))
%>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货