LazUnicode unit
Provides encoding-agnostic Unicode string manipulation functions and an enumerator.
lazunicode.pas provides encoding-agnostic Unicode string
manipulation functions and an enumerator. It works transparently with UTF-8
and UTF-16 encodings, and allows one codebase to work for:
- Lazarus using its default UTF-8 encoding
- Future FPC and Lazarus versions with Delphi compatible UTF-16 encoding
- Delphi compatibility where String is defined as UnicodeString
Behavior of helper functions are altered using the
{$ModeSwitch
UnicodeStrings} directive; the correct routines for handling UTF-8 or
UTF-16 are called based on the mode switch value.
lazunicode.pas is part of the
LazUtils package.
Classes and records
TCodePointEnumerator | class | Base class for a Unicode codepoint enumerator. |
TUnicodeCharacterEnumerator | class | Implements an enumerator for Unicode codepoints. |
TUnicodeEnumeratorBase | class | Base class for a Unicode character enumerator. |
Procedures and functions
CodePointCopy | function | Copies the specified number of codepoints starting at a character position. |
CodePointLength | function | Gets the number of codepoints in the specified string. |
CodePointPos | function | Gets the position where the search value is found in a string. |
CodePointSize | function | Gets the number of bytes needed for a CodePoint in the specified value. |
enumerator(string):TUnicodeCharacterEnumerator | operator | Enumerator which combines diacritical marks. |
IsCombining | function | Determines if the specified value is a combining codepoint. |
StringOfCodePoint | function | Creates a string with the specified number of codepoints. |
UnicodeToWinCP | function | Converts the specified value to the Windows system codepage. |
WinCPToUnicode | function | Converts the specified string to Unicode. |
Uses
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
