Sign in Join
FPDoc Onlineexperiment

UTF16CharStart function

In unit LazUTF16

Gets a pointer to the Unicode character at the ordinal position in P specified by the CharIndex argument.

Declaration

pascal
function UTF16CharStart(P: PWideChar; Len: PtrInt; CharIndex: PtrInt)
: PWideChar

Arguments

P

PWideChar value with the values examined in the routine.

Len

Len is the number of Word values in P.

CharIndex

CharIndex is the position for the desired UnicodeChar (starting at 0).

Function result

Pointer to the Unicode character (code point) at the specified ordinal position.

Description

P is the PWideChar value with the content examined in the routine.

Len contains the number of Word values examined in the P argument.

CharIndex specifies the ordinal position in P for the character pointer in the return value. CharIndex is zero-based and refers to a code point in P and not the individual Word values.

UTF16CharStart calls the UTF16CharacterLength routine to examine and skip each of the code points in P until the code point at CharIndex is found. The return value points to the Unicode character at the specified ordinal position. The return value is Nil for any of the following conditions:

  • The P argument is Nil.
  • Len is zero or a negative number.
  • The code point at CharIndex does not exist in the specified Len.

See also

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