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)
Encodes the given string
s in a x-www-form-urlencoded string using UTF8 character encoding. |
static java.lang.String |
encode(TextualPath path) |
public static java.lang.String encode(java.lang.String s)
s
in a x-www-form-urlencoded string using UTF8 character encoding.
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 '+'s
- the string to be encoded.java.io.UnsupportedEncodingException
- if the specified encoding scheme is invalid.public static java.lang.String encode(TextualPath path)