Save This Page
Home » apache-harmony-6.0-src-r917296-snapshot » java » net » [javadoc | source]
java.net
public class: URLEncoder [javadoc | source]
java.lang.Object
   java.net.URLEncoder
This class is used to encode a string using the format required by {@code application/x-www-form-urlencoded} MIME content type.
Field Summary
static final  String digits     
Method from java.net.URLEncoder Summary:
encode,   encode
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.net.URLEncoder Detail:
 public static String encode(String s) 
Deprecated! use - #encode(String, String) instead.

    Encodes a given string {@code s} in a x-www-form-urlencoded string using the specified encoding scheme {@code enc}.

    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 '+'

 public static String encode(String s,
    String enc) throws UnsupportedEncodingException 
    Encodes the given string {@code s} in a x-www-form-urlencoded string using the specified encoding scheme {@code enc}.

    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 '+'