public class DBCodec
extends java.lang.Object
Constructor and Description |
---|
DBCodec() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
bareBonesDecode(java.lang.String s)
Decodes a
x-www-form-urlencoded string that does not
include the encoded tag. |
static java.lang.String |
bareBonesEncode(java.lang.String s)
Translates a string into encoded format, but doesn't include the
encoded tag.
|
static java.lang.String |
decode(java.lang.String s)
Decodes a
x-www-form-urlencoded string that includes the
encoded tag. |
static java.lang.String |
decode(java.lang.String s,
java.lang.String enc)
Decodes a
application/x-www-form-urlencoded string using a
specific encoding scheme. |
static java.lang.String |
encode(java.lang.String s)
Translates a string into encoded format and include the encoded tag.
|
static java.lang.String |
encode(java.lang.String s,
java.lang.String enc)
Translates a string into encoded format using a specific encoding
scheme.
|
static boolean |
isEncoded(java.lang.String s) |
public static boolean isEncoded(java.lang.String s)
public static java.lang.String encode(java.lang.String s)
s
- The String
to be translated.String
.public static java.lang.String decode(java.lang.String s)
x-www-form-urlencoded
string that includes the
encoded tag.
The platform's default encoding is used to determine what characters are
represented by any consecutive sequences of the form "
%xy
".
s
- The String
to decodeString
public static java.lang.String bareBonesEncode(java.lang.String s)
s
- The String
to be translated.String
.public static java.lang.String bareBonesDecode(java.lang.String s)
x-www-form-urlencoded
string that does not
include the encoded tag.
The platform's default encoding is used to determine what characters are
represented by any consecutive sequences of the form "
%xy
".
s
- The String
to decodeString
public static java.lang.String encode(java.lang.String s, java.lang.String enc) throws java.io.UnsupportedEncodingException
The supplied encoding is used to determine what characters are
represented by any consecutive sequences of the form "
%xy
".
Note: The World Wide Web Consortium Recommendation states that UTF-8 should be used. Not doing so may introduce incompatibilites.
s
- The String
to encodeenc
- The name of a supported
character encoding.String
java.io.UnsupportedEncodingException
- If the named encoding is not supportedpublic static java.lang.String decode(java.lang.String s, java.lang.String enc) throws java.io.UnsupportedEncodingException
application/x-www-form-urlencoded
string using a
specific encoding scheme.
The supplied encoding is used to determine what characters are
represented by any consecutive sequences of the form "
%xy
".
Note: The World Wide Web Consortium Recommendation states that UTF-8 should be used. Not doing so may introduce incompatibilites.
s
- The String
to decodeenc
- The name of a supported
character encoding.String
java.io.UnsupportedEncodingException
- If the named encoding is not supportedCopyright ©, 2005-2012 Prolancer Pty Ltd, Sydney Australia.