It is a named mapping between 16-bit Unicode code units and sequences of bytes.
It knows many kind of namings for charsets.
Safe for concurrent access from threads.
The charset namings are follow the IANA Charset Registry standard.
If a supported naming does not follow the IANA, the name itself starts with "X-" or "x-".
A charset name is composed with the next characters: A..Z, a..z, 0..9, -, +, ., :, _
The name must begin with an alphanumeric character.
Charset names are not case-sensitive.
Every charset has a canonical name and can have many aliases. Canonical names are in uppercase by convention.
A historical name can be canonical or one of the aliases. Can be returned by getEncoding() method of InputStreamReader and OutputStreamReader.
The IANA changes over time. It is important that no aliases should be removed from the charset, and in case a canonical name changes, the old one must become alias.
Always recognized namings (Java standards) are below.
The StandardCharset class provides constants for identifying a standard charset, see below. In order to use them, import the java.nio.charset.StandardCharset class.
EXAMPLE FOR CREATING A CHARSET: