Sign in Join
FPDoc Onlineexperiment

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

treversecharmappingrecordDescribe a Unicode character to single byte character mapping.
TSerializedMapHeaderrecordRecord describing binary file header.
tunicodecharmappingrecordDescribe a single byte character to Unicode character mapping.
tunicodemaprecordUnicode character mapping for single-byte codepage.

Procedures and functions

getasciifunctionConvert Unicode character or string to single-byte character or string.
getmapfunctionFind a codepage map.
getunicodefunctionMap single-byte character to Unicode character.
loadbinaryunicodemappingfunctionLoad binary single-byte codepage to Unicode map from file or memory.
loadunicodemappingfunctionLoad textual single-byte codepage to Unicode map from file.
mappingavailablefunctionCheck if a mapping is available for a specified code page.
registerbinarymappingfunctionLoad and register binary single-byte codepage to Unicode map from file.
registermappingprocedureRegister mapping.

Types

preversecharmappingtypePointer to treversecharmapping.
punicodecharmappingtypePointer to tunicodecharmapping.
punicodemaptypePointer to tunicodemap.
tunicodechartypeUnicode character representation.
tunicodecharmappingflagenumerationInformation flags for Unicode characters.
tunicodestringtypeUnicode string representation.

Constants

BINARY_MAPPING_FILE_EXTconstantDefault extension of binary map file.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.