Castle Game EngineIntroduction Units Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers
|
Unit CastleUnicode
Description
Unicode utilities.
Uses
Overview
Classes, Interfaces, Objects and Records
Functions and Procedures
Types
Description
Functions and Procedures
function UTF8CharacterLength(p: PChar): integer; |
|
function UTF8Length(const s: string): PtrInt; overload; |
|
function UTF8Length(p: PChar; ByteCount: PtrInt): PtrInt; overload; |
|
function UTF8CharStart(UTF8Str: PChar; Len, CharIndex: PtrInt): PChar; |
|
function UTF8Copy(const s: string; StartCharIndex, CharCount: PtrInt): string; |
|
function UTF8CharacterToUnicode(p: PChar; out CharLen: integer): TUnicodeChar; |
Return unicode character pointed by P. CharLen is set to 0 only when pointer P is Nil , otherwise it's always > 0.
The typical usage of this is to iterate over UTF-8 string char-by-char, like this:
var
C: TUnicodeChar;
TextPtr: PChar;
CharLen: Integer;
begin
TextPtr := PChar(S);
C := UTF8CharacterToUnicode(TextPtr, CharLen);
while (C > 0) and (CharLen > 0) do
begin
Inc(TextPtr, CharLen);
C := UTF8CharacterToUnicode(TextPtr, CharLen);
end;
end;
|
function UnicodeToUTF8Inline(CodePoint: TUnicodeChar; Buf: PChar): integer; |
|
Types
Generated by PasDoc 0.15.0.
|