Static Public Member Functions | |
static Charset | toCharset (final Charset charset) |
static Charset | toCharset (final String charset) |
Static Public Attributes | |
static final Charset | ISO_8859_1 = Charset.forName(CharEncoding.ISO_8859_1) |
static final Charset | US_ASCII = Charset.forName(CharEncoding.US_ASCII) |
static final Charset | UTF_16 = Charset.forName(CharEncoding.UTF_16) |
static final Charset | UTF_16BE = Charset.forName(CharEncoding.UTF_16BE) |
static final Charset | UTF_16LE = Charset.forName(CharEncoding.UTF_16LE) |
static final Charset | UTF_8 = Charset.forName(CharEncoding.UTF_8) |
Charsets required of every implementation of the Java platform.
From the Java documentation Standard charsets:
<cite>Every implementation of the Java platform is required to support the following character encodings. Consult the release documentation for your implementation to see if any other encodings are supported. Consult the release documentation for your implementation to see if any other encodings are supported. </cite>
US-ASCII
ISO-8859-1
UTF-8
UTF-16BE
UTF-16LE
UTF-16
This perhaps would best belong in the Commons Lang project. Even if a similar class is defined in Commons Lang, it is not foreseen that Commons Codec would be made to depend on Commons Lang.
This class is immutable and thread-safe.
Definition at line 59 of file Charsets.java.
|
static |
Returns the given Charset or the default Charset if the given Charset is null.
charset | A charset or null. |
Definition at line 73 of file Charsets.java.
|
static |
Returns a Charset for the named charset. If the name is null, return the default Charset.
charset | The name of the requested charset, may be null. |
java.nio.charset.UnsupportedCharsetException | If the named charset is unavailable |
Definition at line 86 of file Charsets.java.
|
static |
CharEncodingISO Latin Alphabet No. 1, a.k.a. ISO-LATIN-1.
Every implementation of the Java platform is required to support this character encoding.
Definition at line 97 of file Charsets.java.
Referenced by org.apache.commons.codec.binary.StringUtils.getBytesIso8859_1(), and org.apache.commons.codec.binary.StringUtils.newStringIso8859_1().
|
static |
Seven-bit ASCII, also known as ISO646-US, also known as the Basic Latin block of the Unicode character set.
Every implementation of the Java platform is required to support this character encoding.
Definition at line 106 of file Charsets.java.
Referenced by org.apache.commons.codec.binary.StringUtils.getBytesUsAscii(), and org.apache.commons.codec.binary.StringUtils.newStringUsAscii().
|
static |
Sixteen-bit Unicode Transformation Format, The byte order specified by a mandatory initial byte-order mark (either order accepted on input, big-endian used on output)
Every implementation of the Java platform is required to support this character encoding.
Definition at line 116 of file Charsets.java.
Referenced by org.apache.commons.codec.binary.StringUtils.getBytesUtf16(), and org.apache.commons.codec.binary.StringUtils.newStringUtf16().
|
static |
Sixteen-bit Unicode Transformation Format, big-endian byte order.
Every implementation of the Java platform is required to support this character encoding.
Definition at line 125 of file Charsets.java.
Referenced by org.apache.commons.codec.binary.StringUtils.getBytesUtf16Be(), and org.apache.commons.codec.binary.StringUtils.newStringUtf16Be().
|
static |
Sixteen-bit Unicode Transformation Format, little-endian byte order.
Every implementation of the Java platform is required to support this character encoding.
Definition at line 134 of file Charsets.java.
Referenced by org.apache.commons.codec.binary.StringUtils.getBytesUtf16Le(), and org.apache.commons.codec.binary.StringUtils.newStringUtf16Le().
|
static |
Eight-bit Unicode Transformation Format.
Every implementation of the Java platform is required to support this character encoding.
Definition at line 143 of file Charsets.java.
Referenced by org.apache.commons.codec.binary.StringUtils.getBytesUtf8(), and org.apache.commons.codec.binary.StringUtils.newStringUtf8().