asp用Server.URLEncode()转换的汉字字符串如何再转换回来

用Server.URLEncode()转换的汉字字符串 如何再转换回来
在.net中是用Server.UrlDecode(),那在ASP里怎么转换,能举个实例吗
网友有的说自己写
代码如下:

function URLDecode (str)
dim pos, strTemp
str = REPLACE(str,"+", " ")
strTemp = ""
pos = INSTR(str,"%")
DO WHILE pos > 0
strTemp = strTemp & LEFT(str,pos-1) & CHR(EVAL("&H" & MID(str, pos+1,2)))
str = MID(str, pos + 3)
pos = instr(str,"%")
LOOP
strTemp = strTemp & str
URLDecode = strTemp
end function

可是要怎么用啊
我本想用Server.UrlDecode()但是却提示
Microsoft VBScript 运行时错误 错误 '800a01b6'
对象不支持此属性或方法: 'UrlDecode'

用 newstr=UrlDecode(oldstr) 还是一样的错误啊

第1个回答  2007-02-25
用 newstr=UrlDecode(oldstr) 就行了