[Overview][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'LazUTF8' (#lazutils)

UTF8FindNearestCharStart

Finds the start of the UTF-8 character at the specified position.

Declaration

Source position: lazutf8.pas line 96

function UTF8FindNearestCharStart(

  UTF8Str: PChar;

  Len: SizeInt;

  BytePos: SizeInt

):SizeInt;

Arguments

UTF8Str

  

Values to examine in the function.

Len

  

Length of the input values.

BytePos

  

Offset into UTF8Str for the initial byte value.

Function result

Position where the next codepoint begins.

Description

Find the start of the UTF-8 character which contains BytePos. If BytePos is not part of a valid UTF-8 Codepoint the function returns BytePos. BytePos values starts at position 0.

Len is the length in bytes.


Version 3.2 Generated 2024-02-25 Home