public static String encodeUri(String uri,
String encoding)
throws UnsupportedEncodingException
Encodes the given source URI into an encoded String. All various URI components are encoded according to their respective valid character sets.
Parameters:
uri - the URI to be encoded
encoding - the character encoding to encode to
Returns:
the encoded URI
Throws:
IllegalArgumentException - when the given uri parameter is not a valid URI
UnsupportedEncodingException - when the given encoding parameter is not supported
1 回答
使用encodeUri