URLDecode2 Function:
Decodes a urlencoded string.
Description:
The URLDecode2 function decodes a URL encoded string back into the original text.
Syntax:
string = URLDecode2(encodedstring)
Example:
<%
Response.Write URLDecode2(Server.URLEncode("@ can't find ... that & this?"))
%>
ASP Source Code:
<%
function URLDecode2(strString) strString = Replace(strString, "%2F", "/") strString = Replace(strString, "%7C", "|") strString = Replace(strString, "%3F", "?") strString = Replace(strString, "%21", "!") strString = Replace(strString, "%40", "@") strString = Replace(strString, "%5C", "\") strString = Replace(strString, "%23", "#") strString = Replace(strString, "%24", "$") strString = Replace(strString, "%5E", "^") strString = Replace(strString, "%26", "&") strString = Replace(strString, "%25", "%") strString = Replace(strString, "%2A", "*") strString = Replace(strString, "%28", "(") strString = Replace(strString, "%29", ")") strString = Replace(strString, "%7D", "}") strString = Replace(strString, "%3A", ":") strString = Replace(strString, "%2C", ",") strString = Replace(strString, "%7B", "{") strString = Replace(strString, "%2B", "+") strString = Replace(strString, "%2E", ".") strString = Replace(strString, "%2D", "-") strString = Replace(strString, "%7E", "~") strString = Replace(strString, "%2D", "-") strString = Replace(strString, "%5B", "[") strString = Replace(strString, "%5F", "_") strString = Replace(strString, "%5D", "]") strString = Replace(strString, "%60", "`") strString = Replace(strString, "%3D", "=") strString = Replace(strString, "%27", "'") strString = Replace(strString, "+", " ") strString = Replace(strString, "%22", Chr(34)) myURLDecode = strString End function
%>
|