public final class URIComponent extends Object
decodeURIComponent
function.Modifier and Type | Method and Description |
---|---|
static String |
decode(String uri)
Decodes the provided string encoded in UTF-8 using a specification that is
compatible with JavaScript's
decodeURIComponent function. |
static String |
decode(String uri,
String encoding)
Decodes the provided string using a specification that is compatible with
JavaScript's
decodeURIComponent function. |
static String |
encode(String uri)
Encodes the provided string as UTF-8 using a specification that is
compatible with JavaScript's
encodeURIComponent function. |
static String |
encode(String uri,
String enc)
Encodes the provided string using a specification that is compatible with
JavaScript's
encodeURIComponent function. |
public static String decode(String uri)
decodeURIComponent
function.uri
- The encoded String
encoded in UTF-8 to be decoded.String
, or null
if the provided string
is null.UnsupportedOperationException
- If character encoding needs to be
consulted, but named character encoding is not supported.public static String decode(String uri, String encoding) throws UnsupportedEncodingException
decodeURIComponent
function.uri
- The encoded String
to be decoded.encoding
- The name of a supported character encoding.String
, or null
if the provided string
is null.UnsupportedEncodingException
- If character encoding needs to be
consulted, but named character encoding is not supported.public static String encode(String uri)
encodeURIComponent
function.uri
- The String
to be encoded.String
, or null
if the provided string
is null.public static String encode(String uri, String enc) throws UnsupportedEncodingException
encodeURIComponent
function.uri
- The String
to be encoded.enc
- The name of a supported character encoding.String
, or null
if the provided string
is null.UnsupportedEncodingException
- If character encoding needs to be
consulted, but named character encoding is not supported.Copyright © 2019 LibJ. All rights reserved.