CharacterEncoding
Description
- Derived from
- Extended by
-
CharacterEncodingSimple abstract
Base class for single-byte and multi-byte character encodings.
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'
-
UTF_32_BE:
'utf32be'
-
UTF_32_LE:
'utf32'
,'utf32le'
-
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.
Encodes the given Unicode character.
- IOException
-
If an I/O error has occurred.
EncodeString
Converts the given UTF-16 code unit sequence to an encoded string.
Characters that cannot be encoded will be replaced with the code for EncodeReplacement. 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.
Public / Attributes
EncodeReplacement
Returns the replacement character that is used for encoding when a character cannot be represented.
The default implementation returns DecodeReplacement.