|[Overview][Procedures and functions][Variables][Index]||Reference for unit 'fpwidestring' (#rtl)|
Native Object Pascal Unicode string support
Unicode data management
fpwidestring implements Unicode string support for the Free Pascal RTL using native Object Pascal routines. It is meant to be used on operating systems where the operating system does not natively support Unicode transformations and operations.
In general, it is sufficient to include the unit in the uses clause of a program. The initialization code of the unit will set the Unicode string manager of the system unit to the object pascal implementation contained in this unit.
This unit needs Unicode collation and character set tables in order to be able to do its work correctly. These must be registered using the routines of the unicodedata unit: the FPC project distributes some Unicode collation data in .bco files which can be loaded using the LoadCollation routine.
In order for sorting and comparing of strings to work, a collation must be used. The collation in general depends on the internationalization of the application. Since the system unit does not know about collations, the collation must be set in the fpWideString unit using the SetActiveCollation function. The collation can be set on a per-thread basis.
New threads get DefaultCollationName as the active collation name.
The fpwidestring unit performs conversions between Unicode and single-byte ansistring conversions (excluding UTF8). Support for various single-byte encodings are based on the charset unit. This unit can be used to load single byte code pages. Various code page units such as cp895, cp932, cp950 are provided by the "rtl-unicode" package.
The fpwidestring requires at least the Default Unicode Collation Element Table to be registered (called DUCET). The DUCET encoding is provided by the unicodeducet unit. More information can be found in the unicodedata unit.