|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.net.URLDecoder
public class URLDecoder
This utility class contains static methods that converts a string encoded in the x-www-form-urlencoded format to the original text. The x-www-form-urlencoded format replaces certain disallowed characters with encoded equivalents. All upper case and lower case letters in the US alphabet remain as is, the space character (' ') is replaced with '+' sign, and all other characters are converted to a "%XX" format where XX is the hexadecimal representation of that character in a given character encoding (default is "UTF-8").
This method is very useful for decoding strings sent to CGI scripts Written using on-line Java Platform 1.2/1.4 API Specification. Status: Believed complete and correct.
Constructor Summary | |
---|---|
URLDecoder()
Public contructor. |
Method Summary | |
---|---|
static String |
decode(String s)
Deprecated. |
static String |
decode(String s,
String encoding)
This method translates the passed in string from x-www-form-urlencoded format using the given character encoding to decode the hex encoded unsafe characters. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public URLDecoder()
Method Detail |
---|
public static String decode(String s)
s
- the String to convert
public static String decode(String s, String encoding) throws UnsupportedEncodingException
s
- the String to convertencoding
- the character encoding to use the decode the hex encoded
unsafe characters
UnsupportedEncodingException
- If the named encoding is not
supported
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |