public class URLDecoder extends Object
application/x-www-form-urlencoded MIME content type.| Constructor and Description |
|---|
URLDecoder() |
| Modifier and Type | Method and Description |
|---|---|
static String |
decode(String s)
Deprecated.
Use
decode(String, String) instead. |
static String |
decode(String s,
Charset charset)
Decodes an
application/x-www-form-urlencoded string using
a specific Charset. |
static String |
decode(String s,
String charsetName)
Decodes the argument which is assumed to be encoded in the
x-www-form-urlencoded MIME content type, assuming the given charsetName. |
@Deprecated public static String decode(String s)
decode(String, String) instead.x-www-form-urlencoded MIME content type.
'+' will be converted to space, '%' and two following hex digit characters are converted to the equivalent byte value. All other characters are passed through unmodified. For example "A+B+C %24%25" -> "A B C $%".
s - the encoded string.public static String decode(String s, String charsetName) throws UnsupportedEncodingException
x-www-form-urlencoded MIME content type, assuming the given charsetName.
'+' will be converted to space, '%' and two following hex digit characters are converted to the equivalent byte value. All other characters are passed through unmodified. For example "A+B+C %24%25" -> "A B C $%".
UnsupportedEncodingException - if charsetName is not supported.public static String decode(String s, Charset charset)
application/x-www-form-urlencoded string using
a specific Charset.
The supplied charset is used to determine
what characters are represented by any consecutive sequences of the
form "%xy".
Note: The World Wide Web Consortium Recommendation states that UTF-8 should be used. Not doing so may introduce incompatibilities.
s - the String to decodecharset - the given charsetStringNullPointerException - if s or charset is nullIllegalArgumentException - if the implementation encounters illegal
charactersURLEncoder.encode(java.lang.String, java.nio.charset.Charset)