- 论坛徽章:
- 0
|
只有vbs的,有人改写成js的记得发给我一份
- <script language=vbs>
- function urldecoding(vstrin)
- dim i,strreturn,strSpecial
- strSpecial = "!""#$%&'()*+,/:;<=>?@[\]^`{ |}~%"
- strreturn = ""
- for i = 1 to len(vstrin)
- thischr = mid(vstrin,i,1)
- if thischr="%" then
- intasc=eval("&h"+mid(vstrin,i+1,2))
- if instr(strSpecial,chr(intasc))>0 then
- strreturn= strreturn & chr(intasc)
- i=i+2
- else
- intasc=eval("&h"+mid(vstrin,i+1,2)+mid(vstrin,i+4,2))
- strreturn= strreturn & chr(intasc)
- i=i+5
- end if
- else
- if thischr="+" then
- strreturn = strreturn & " "
- else
- strreturn = strreturn & thischr
- end if
- end if
- next
- urldecoding = strreturn
- end function
- </script>
复制代码 |
|