|
Préférences
Moteurs de recherche
|
||||||||
JavaTM 2 Platform Std. Ed. v1.5.0
java.net
|
Method Summary | |
---|---|
static String |
encode(String s)
Deprecated. The resulting string may vary depending on the platform's default encoding. Instead, use the encode(String,String) method to specify the encoding. |
static String |
encode(String s,
String enc)
Translates a string into application/x-www-form-urlencoded
format using a specific encoding scheme. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
@Deprecated public static String encode(String s)
x-www-form-urlencoded
format. This method uses the platform's default encoding
as the encoding scheme to obtain the bytes for unsafe characters.
s
- String
to be translated.
String
.public static String encode(String s, String enc) throws UnsupportedEncodingException
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.
s
- String
to be translated.enc
- The name of a supported
character
encoding.
String
.
UnsupportedEncodingException
- If the named encoding is not supportedURLDecoder.decode(java.lang.String, java.lang.String)