use encode public static String encode(String s, String enc) throws UnsupportedEncodingException Translates a string into application/x-www-form-urlencoded format using a specific encoding scheme. This method uses the supplied encoding scheme to obtain the bytes for unsafe characters. Note: The World Wide Web Consortium Recommendation states that UTF-8 should be used. Not doing so may introduce incompatibilites. Parameters:s - String to be translated.enc - The name of a supported character encoding. Returns:the translated String. Throws: UnsupportedEncodingException - If the named encoding is not supported Since:1.4
encode public static String encode(String s,
String enc)
throws UnsupportedEncodingException
Translates a string into application/x-www-form-urlencoded format using a specific encoding scheme. This method uses the supplied encoding scheme to obtain the bytes for unsafe characters.
Note: The World Wide Web Consortium Recommendation states that UTF-8 should be used. Not doing so may introduce incompatibilites.
Parameters:s - String to be translated.enc - The name of a supported character encoding.
Returns:the translated String.
Throws: UnsupportedEncodingException - If the named encoding is not supported
Since:1.4