Last active
November 14, 2015 03:21
-
-
Save indywidualny/a3da6094977e017d987b to your computer and use it in GitHub Desktop.
URL decoder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// url decoder, recreate all the special characters | |
private static String urlDecode (String url) { | |
return url.replace("%3C", "<").replace("%3E", ">").replace("%23", "#").replace("%25", "%") | |
.replace("%7B", "{").replace("%7D", "}").replace("%7C", "|").replace("%5C", "\\") | |
.replace("%5E", "^").replace("%7E", "~").replace("%5B", "[").replace("%5D", "]") | |
.replace("%60", "`").replace("%3B", ";").replace("%2F", "/").replace("%3F", "?") | |
.replace("%3A", ":").replace("%40", "@").replace("%3D", "=").replace("%26", "&") | |
.replace("%24", "$").replace("%2B", "+").replace("%22", "\"").replace("%2C", ",") | |
.replace("%20", " "); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment