Top Description Fields Constructors Methods
org.apache.commons.lang3

public Class CharEncoding

extends Object
Class Inheritance
Annotations
@Deprecated
Imports
java.nio.charset.Charset, .IllegalCharsetNameException, .StandardCharsets

Deprecated

Java 7 introduced java.nio.charset.StandardCharsets, which defines these constants as Charset objects. Use Charset#name() to get the string values provided in this class. This class will be removed in a future release.

Character encoding names required of every implementation of the Java platform.

According to JRE character encoding names:

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.

Since
2.1
See Also
JRE character encoding names

Field Summary

Modifier and TypeField and Description
public static final String
ISO_8859_1

ISO Latin Alphabet #1, also known as ISO-LATIN-1.

public static final String
US_ASCII

Seven-bit ASCII, also known as ISO646-US, also known as the Basic Latin block of the Unicode character set.

public static final String
UTF_16

Sixteen-bit Unicode Transformation Format, byte order specified by a mandatory initial byte-order mark (either order accepted on input, big-endian used on output).

public static final String
UTF_16BE

Sixteen-bit Unicode Transformation Format, big-endian byte order.

public static final String
UTF_16LE

Sixteen-bit Unicode Transformation Format, little-endian byte order.

public static final String
UTF_8

Eight-bit Unicode Transformation Format.

Constructor Summary

AccessConstructor and Description
public
CharEncoding()
Deprecated Will be removed in 4.0.0.

Constructs a new instance.

Method Summary

Modifier and TypeMethod and Description
public static boolean

Returns:

true if the charset is available in the current Java virtual machine
isSupported
(final String
the name of the requested charset; may be either a canonical name or an alias, null returns false
name
)
Deprecated Please use Charset#isSupported(String) instead, although be aware that null values are not accepted by that method and an IllegalCharsetNameException may be thrown.

Tests whether the named charset is supported.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ISO_8859_1back to summary
public static final String ISO_8859_1

ISO Latin Alphabet #1, also known as ISO-LATIN-1.

Every implementation of the Java platform is required to support this character encoding.

US_ASCIIback to summary
public static final String US_ASCII

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.

UTF_16back to summary
public static final String UTF_16

Sixteen-bit Unicode Transformation Format, 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.

UTF_16BEback to summary
public static final String UTF_16BE

Sixteen-bit Unicode Transformation Format, big-endian byte order.

Every implementation of the Java platform is required to support this character encoding.

UTF_16LEback to summary
public static final String UTF_16LE

Sixteen-bit Unicode Transformation Format, little-endian byte order.

Every implementation of the Java platform is required to support this character encoding.

UTF_8back to summary
public static final String UTF_8

Eight-bit Unicode Transformation Format.

Every implementation of the Java platform is required to support this character encoding.

Constructor Detail

CharEncodingback to summary
public CharEncoding()

Deprecated

Will be removed in 4.0.0.

Constructs a new instance.

Annotations
@Deprecated

Method Detail

isSupportedback to summary
public static boolean isSupported(final String name)

Deprecated

Please use Charset#isSupported(String) instead, although be aware that null values are not accepted by that method and an IllegalCharsetNameException may be thrown.

Tests whether the named charset is supported.

This is similar to java.nio.charset.Charset.isSupported(String) but handles more formats

Parameters
name:String

the name of the requested charset; may be either a canonical name or an alias, null returns false

Returns:boolean

true if the charset is available in the current Java virtual machine

Annotations
@Deprecated