public class URLEncoder
extends java.lang.Object
Constructor and Description |
---|
URLEncoder() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
encode(java.lang.String s,
boolean ascii)
Encode a string for inclusion in a URI.
|
static java.lang.String |
encode(java.lang.String URL,
java.lang.String force,
boolean ascii) |
static java.lang.String |
encode(java.lang.String URL,
java.lang.String force,
boolean ascii,
java.lang.String extraSafeChars)
Encode a string for inclusion in a URI.
|
static java.lang.String |
getSafeURLCharacters() |
public static java.lang.String getSafeURLCharacters()
public static java.lang.String encode(java.lang.String URL, java.lang.String force, boolean ascii)
public static java.lang.String encode(java.lang.String URL, java.lang.String force, boolean ascii, java.lang.String extraSafeChars)
URL
- String to encodeforce
- List of characters (in the form of a string) which must be encoded as well as the built-in.ascii
- If true, encode all foreign letters, if false, leave them as is. Set to true if you are
passing to something that needs ASCII (e.g. HTTP headers), set to false if you are using in an HTML page.public static java.lang.String encode(java.lang.String s, boolean ascii)
URL
- String to encodeascii
- If true, encode all foreign letters, if false, leave them as is. Set to true if you are
passing to something that needs ASCII (e.g. HTTP headers), set to false if you are using in an HTML page.