charset unit
Character set support.
The charset unit can be used to load single-byte character set (code page) descriptions. It is used in the fpwidestring unit to add support for converting single-byte codepage strings to Unicode strings (and vice versa).
Data of a code page may be included using one of the ready-made units, or
can be loaded (in a binary form) at runtime with the loadbinaryunicodemapping function.
The binary files have the .bcm extension and are produced by
the creumap utility distributed with Free Pascal.
Pre-made units are available for the following codepages: cp895, cp932, cp936, cp949 and cp950.
Classes and records
treversecharmapping | record | Describe a Unicode character to single byte character mapping. |
TSerializedMapHeader | record | Record describing binary file header. |
tunicodecharmapping | record | Describe a single byte character to Unicode character mapping. |
tunicodemap | record | Unicode character mapping for single-byte codepage. |
Procedures and functions
getascii | function | Convert Unicode character or string to single-byte character or string. |
getmap | function | Find a codepage map. |
getunicode | function | Map single-byte character to Unicode character. |
loadbinaryunicodemapping | function | Load binary single-byte codepage to Unicode map from file or memory. |
loadunicodemapping | function | Load textual single-byte codepage to Unicode map from file. |
mappingavailable | function | Check if a mapping is available for a specified code page. |
registerbinarymapping | function | Load and register binary single-byte codepage to Unicode map from file. |
registermapping | procedure | Register mapping. |
Types
preversecharmapping | type | Pointer to treversecharmapping. |
punicodecharmapping | type | Pointer to tunicodecharmapping. |
punicodemap | type | Pointer to tunicodemap. |
tunicodechar | type | Unicode character representation. |
tunicodecharmappingflag | enumeration | Information flags for Unicode characters. |
tunicodestring | type | Unicode string representation. |
Constants
BINARY_MAPPING_FILE_EXT | constant | Default extension of binary map file. |
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
