|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectucar.nc2.util.net.URLencode
@Deprecated public class URLencode
Provides a method to encode any string into a URL-safe form. Non-ASCII characters are first encoded as sequences of two or three bytes, using the UTF-8 algorithm, before being encoded as %HH escapes.
Created: 17 April 1997 Author: Bert Bos
Constructor Summary | |
---|---|
URLencode()
Deprecated. |
Method Summary | |
---|---|
static String |
escape(String s)
Deprecated. Encode a string to the "x-www-form-urlencoded" form, enhanced with the UTF-8-in-URL proposal. |
static void |
main(String[] args)
Deprecated. |
static String |
unescape(String s)
Deprecated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public URLencode()
Method Detail |
---|
public static String escape(String s)
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 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".
s
- The string to be encoded
public static String unescape(String s)
public static void main(String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |