public static String urlDecode ( String s ) { try { return URLDecoder . decode ( s , StandardCharsets . UTF_8 . name ( ) ) ; } catch ( UnsupportedEncodingException e ) { throw new IllegalStateException ( "get a jdk that actually supports utf-8" , e ) ; } }
Url decode a string and don t throw a checked exception . Uses UTF - 8 as per RFC 3986 .