Posted By

pablazo on 01/31/07


Tagged

ASP urldecode urlencode


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

fuzzylogic


UrlDecode Method


 / Published in: ASP
 

URL: http://flangy.com/dev/asp/urldecode.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

Report this snippet  

You need to login to post a comment.