URLDecoder is converting '+' into space

Do this on your string before decoding:

String plusEncoded = yourString.replaceAll("\\+", "%2b")

The decoder will then show + where it should've been


According to HTML URL Encoding Reference:

URLs cannot contain spaces. URL encoding normally replaces a space with a plus (+) sign or with %20.

and + sign itself must be encoded with %2B. So if you want to pass your hash as a GET parameter in URL, you should replace plus signs with %2B in your hash. Do not replace every + in the entire URL because you might ruin other string parameters which suppose to contain spaces.