TEncoding class
Encoding support.
Declaration
TEncoding = classDescends from it: TMBCSEncoding TUnicodeEncoding
Description
TEncoding is a mostly abstract class that contains various methods to deal with different encodings
in single- and double-byte strings. In practice, one instance of a descendent of this class for each needed encoding can be
instantiated and used. The class contains several class methods and properties to create such instances, and
has several often-used instances available as class properties, in particular the default encoding.
When using encodings (and in particular Default or ANSI),
if the DefaultSystemCodePage changes,
you should call FreeEncodings to regenerate the encodings.
See also
Properties
CodePage | public | Codepage for this encoding. |
EncodingName | public | Name of this encoding. |
IsSingleByte | public | Is the encoding a single-byte encoding or not ? |
ANSI | public | Ansi encoding instance. |
ASCII | public | ASCII encoding instance. |
BigEndianUnicode | public | Big-endian Unicode (UTF16BE) encoding instance. |
Default | public | Default codepage. |
SystemEncoding | public | System encoding. |
Unicode | public | UTF16 encoding instance. |
UTF7 | public | UTF7 encoding instance. |
UTF8 | public | UTF8 encoding instance. |
Methods
GetByteCount | strict prote | |
GetBytes | strict prote | |
GetCharCount | strict prote | |
GetChars | strict prote | |
GetAnsiBytes | strict prote | |
GetAnsiString | strict prote | |
GetCodePage | strict prote | |
GetEncodingName | strict prote | |
Clone | public | Clone a TEncoding instance. |
Convert | public | Convert an array of bytes from one encoding to another. |
IsStandardEncoding | public | Check if the encoding is one of the standard encodings. |
GetBufferEncoding | public | Attempt to guess the encoding of a buffer. |
GetEncoding | public | Get an encoding instance for a given codepage. |
GetMaxByteCount | public | Returns the maximum number of bytes needed to represent a string. |
GetMaxCharCount | public | Return the maximum number of characters that can be represented in a number of bytes. |
GetPreamble | public | Return the BOM Marker used by the encoding. |
GetString | public | Return a string based on an array of bytes. |
Fields
FIsSingleByte | strict prote | |
FMaxCharSize | strict prote |
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
