Package java.net
Class URLEncoder
- java.lang.Object
-
- java.net.URLEncoder
-
public class URLEncoder extends Object
This class is used to encode a string using the format required byapplication/x-www-form-urlencodedMIME 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 '+'.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Stringencode(String s)Deprecated.Useencode(String, String)instead.static Stringencode(String s, String charsetName)
-
-
-
Method Detail
-
encode
@Deprecated public static String encode(String s)
Deprecated.Useencode(String, String)instead.Equivalent toencode(s, "UTF-8").
-
encode
public static String encode(String s, String charsetName) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
-