CharacterEncoding
Description
- Extended by
-
CharacterEncodingSimple abstract
Base class for single-byte and multi-byte character encodings.
Only non-surrogate (see CharacterCategory.OtherSurrogate) Unicode characters in the range [0..65535] may be encoded to resp. decoded from a byte sequence. All other characters will result in Unprintables.
Public / Constants
SimpleHttp
A ISimpleHttpText object that uses the built-in character encoding to decode text data.
- See also
Public / Constructors
For
Returns a character encoding by its name.
The given name is normalized before trying to find a character encoding: First, the name is converted to lower-case. Then, all characters that are neither letters nor digits are removed (i.e. only '0'..'9'
, 'a'..'z'
are retained). The resulting normalized name is then tested against the following values in order to find a character encoding:
-
UTF_8:
'utf8'
-
UTF_16_BE:
'utf16be'
-
UTF_16_LE:
'utf16'
,'utf16le'
-
CharacterEncodingSimple.ISO_8859_1:
'cp1252'
,'iso88591'
,'latin1'
,'windows1252'
-
CharacterEncodingSimple.ASCII:
'ascii'
,'usascii'
-
CharacterEncodingSimple.Cp437:
'437'
,'cp437'
,'ibm437'
Public / Methods
Decode
2 overloads
Decodes a single unicode character.
Decodes a single unicode character.
- IOException
-
If an I/O error has occurred.
Encode
2 overloads
Encodes the given unicode character.
Characters that cannot be encoded will be replaced with '?'
.
Encodes the given unicode character.
Characters that cannot be encoded will be replaced with '?'
.
- IOException
-
If an I/O error has occurred.
EncodeCount
Encodes the given unicode character.
Characters that cannot be encoded will be replaced with '?'
.
EncodeString
Converts the given unicode string to this encoding.
The encoded bytes will be written to bytes opt beginning at the current buffer position. Before returning, this method sets the ByteBuffer.Position and ByteBuffer.Limit to the range of encoded bytes that have been output.