|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.webmethods.rtl.encode.Encoder
com.webmethods.rtl.encode.URLEncoder
public class URLEncoder
Encodes to and from URL-escaping. See http://www.w3.org/International/O-URL-code.html.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.webmethods.rtl.encode.Encoder |
---|
Encoder.FixedCharArrayWriter |
Field Summary | |
---|---|
protected static Encoder |
encoder
|
Constructor Summary | |
---|---|
URLEncoder()
|
Method Summary | |
---|---|
int |
decode(char[] src,
int soff,
int len,
Writer dst)
Decodes from URL-escaped format. |
int |
encode(char[] src,
int soff,
int len,
Writer dst)
Encode a string to the "x-www-form-urlencoded" form, enhanced with the UTF-8-in-URL proposal. |
static Encoder |
encoder()
Returns the encoder instance. |
Methods inherited from class com.webmethods.rtl.encode.Encoder |
---|
decode, decode, decode, decode, decode, decode, encode, encode, encode, encode, encode, encode |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static Encoder encoder
Constructor Detail |
---|
public URLEncoder()
Method Detail |
---|
public static Encoder encoder()
public int encode(char[] src, int soff, int len, Writer dst) throws IOException
The ASCII characters 'a' through 'z', 'A' through 'Z', and '0' through '9' remain the same.
The unreserved characters - _ . ! ~ * ' ( ) remain the same.
The space character ' ' is not converted into a plus sign '+'.
All other ASCII characters are converted into the 3-character string "%xy", where xy is the two-digit hexadecimal representation of the character code
All non-ASCII characters are encoded in two steps: first to a sequence of 2 or 3 bytes, using the UTF-8 algorithm; secondly each of these bytes is encoded as "%xx".
encode
in class Encoder
src
- Char array to encode.soff
- Offset in the src array at which to begin reading.len
- Length of src array to encode.dst
- Writer in which to write the encoded chars.
IOException
public int decode(char[] src, int soff, int len, Writer dst) throws IOException
decode
in class Encoder
src
- Char array to decode.soff
- Offset in the src array at which to begin reading.len
- Length of src array to decode.dst
- Writer in which to write the decoded chars.
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |