public class URLEncoder extends java.lang.Object
This method is very useful for encoding strings to be sent to CGI scripts
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
encode(java.lang.String s)
Deprecated.
|
static java.lang.String |
encode(java.lang.String s,
java.lang.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 java.lang.String encode(java.lang.String s)
s - The String to convertpublic static java.lang.String encode(java.lang.String s, java.lang.String encoding) throws java.io.UnsupportedEncodingException
s - The String to convertencoding - The encoding to use for unsafe charactersjava.io.UnsupportedEncodingException - If the named encoding is not
supported