UrlDecode Method


/ Published in: ASP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. ' An inverse to Server.URLEncode
  2. function URLDecode(str)
  3. dim re
  4. set re = new RegExp
  5.  
  6. str = Replace(str, "+", " ")
  7.  
  8. re.Pattern = "%([0-9a-fA-F]{2})"
  9. re.Global = True
  10. URLDecode = re.Replace(str, GetRef("URLDecodeHex"))
  11. end function
  12.  
  13. ' Replacement function for the above
  14. function URLDecodeHex(match, hex_digits, pos, source)
  15. URLDecodeHex = chr("&H" & hex_digits)
  16. end function

URL: http://flangy.com/dev/asp/urldecode.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.