Build 1.0_r1(from source)

java.net
Class URLEncoder

java.lang.Object
  extended by java.net.URLEncoder

public class URLEncoder
extends Object

This class is used to encode a string using the format required by application/x-www-form-urlencoded MIME content type.


Field Summary
(package private) static String digits
           
 
Method Summary
static String encode(String s)
          Deprecated. use encode(String, String) instead
static String encode(String s, String enc)
          This class contains a utility method for converting a string to the format required by the application/x-www-form-urlencoded MIME content type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

digits

static final String digits
See Also:
Constant Field Values
Method Detail

encode

@Deprecated
public static String encode(String s)
Deprecated. use encode(String, String) instead

This class contains a utility method for converting a string to the format required by the application/x-www-form-urlencoded MIME content type.

All characters except letters ('a'..'z', 'A'..'Z') and numbers ('0'..'9') and characters '.', '-', '*', '_' are converted into their hexidecimal value prepended by '%'.

For example: '#' -> %23

In addition, spaces are substituted by '+'

Parameters:
s - java.lang.String the converted string
Returns:
java.lang.String the string to be converted

encode

public static String encode(String s,
                            String enc)
                     throws UnsupportedEncodingException
This class contains a utility method for converting a string to the format required by the application/x-www-form-urlencoded MIME content type. All characters except letters ('a'..'z', 'A'..'Z') and numbers ('0'..'9') and characters '.', '-', '*', '_' are converted into their hexadecimal value prepended by '%'. For example: '#' -> %23 In addition, spaces are substituted by '+'

Parameters:
s - the string to be converted
Returns:
the converted string
Throws:
UnsupportedEncodingException

Build 1.0_r1(from source)

Please submit a feedback, bug or feature