public class URLEncoder extends Object
This method is very useful for encoding strings to be sent to CGI scripts
Modifier and Type | Method and Description |
---|---|
static String |
encode(String s)
Deprecated.
|
static String |
encode(String s,
String encoding)
This method translates the passed in string into x-www-form-urlencoded
format using the character encoding to hex-encode the unsafe characters.
|
public static String encode(String s)
s
- The String to convertpublic static String encode(String s, String encoding) throws UnsupportedEncodingException
s
- The String to convertencoding
- The encoding to use for unsafe charactersUnsupportedEncodingException
- If the named encoding is not
supported