用这个函数试试。
Function URLDecode(enStr)
dim deStr
dim c,i,v
deStr=""
for i=1 to len(enStr)
c=Mid(enStr,i,1)
if c="%" then
v=eval("&h"+Mid(enStr,i+1,2))
if v<128 then
deStr=deStr&chr(v)
i=i+2
else
if isvalidhex(mid(enstr,i,3)) then
if isvalidhex(mid(enstr,i+3,3)) then
v=eval("&h"+Mid(enStr,i+1,2)+Mid(enStr,i+4,2))
deStr=deStr&chr(v)
i=i+5
else
v=eval("&h"+Mid(enStr,i+1,2)+cstr(hex(asc(Mid(enStr,i+3,1)))))
deStr=deStr&chr(v)
i=i+3
end if
else
destr=destr&c
end if
end if
else
if c="+" then
deStr=deStr&" "
else
deStr=deStr&c
end if
end if
next
URLDecode=deStr
end functionfunction isvalidhex(str)
isvalidhex=true
str=ucase(str)
if len(str)<>3 then isvalidhex=false:exit function
if left(str,1)<>"%" then isvalidhex=false:exit function
c=mid(str,2,1)
if not (((c>="0") and (c<="9")) or ((c>="A") and (c<="Z"))) then isvalidhex=false:exit function
c=mid(str,3,1)
if not (((c>="0") and (c<="9")) or ((c>="A") and (c<="Z"))) then isvalidhex=false:exit function
end function
str="%B7%C9"
str=URLDecode(str)
response.write str

解决方案 »

  1.   

    这是字符编码问题,我的是php用gb2312,urldecode(‘%B7%C9’),可以解码,js默认编码是utf-8,你需要转码
      

  2.   

    var str="%B7%C9";
    alert(unescape(str));
      

  3.   

    你要实现的功能可否说的详细点,非得用js读吗?其他语言,如java,c#,php提供的转码功能都比js强
      

  4.   


    因为我要在静态页读这个url字段
    所以要js
      

  5.   

    是这样啊,那就让页面采用utf-8编码吧,飞使用utf-8编码是%E9%A3%9E ,这样js就不会出错了。
      

  6.   

    方法一:用vbs,比较直接,也比较方便,反正js和vbs的方法可以互调,但有些浏览器不支持(1楼)
    方法二:有个js版的urlencode方法实现,某牛人定义了一个转换的字库总之js暂时还没有内置这样一个转换库