UTF8CodepointToByteIndex function
Finds the byte index of the n-th UTF-8 codepoint.
Declaration
function UTF8CodepointToByteIndex(UTF8Str: PChar; Len: PtrInt;
CodepointIndex: PtrInt): PtrIntDescription
UTF8CodepointToByteIndex is a
PtrInt function used to
find the byte index in UTF8Str where the n-th UTF-8 codepoint is located. It
calls UTF8CodepointStart to get a pointer to the requested codepoint position.
The return value contains the difference between the pointer offsets in each of the PChar values. The return value is -1 when a codepoint is not found at the specified position.
UTF8CodepointToByteIndex ignores BIDI mode.
See also
- UTF8CodepointStart
- UTF8CharToByteIndex
An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.
