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

UTF8CompareStr

Compares the UTF-8-encoded string values.

Declaration

Source position: lazutf8.pas line 174

function UTF8CompareStr(

  const S1: string;

  const S2: string

):PtrInt;

function UTF8CompareStr(

  S1: PChar;

  Count1: SizeInt;

  S2: PChar;

  Count2: SizeInt

):PtrInt;

Arguments

S1

  

First value for the comparison.

S2

  

Second value for the comparison.

Function result

Relative order for the compared values.

Arguments

S1

  

First value for the comparison.

Count1

  

Length of the first value.

S2

  

Second value for the comparison.

Count2

  

Length of the second value.

Description

UTF8CompareStr is a function used to compare the specified UTF-8-encoded string values. The return value indicates the relative sort order for the compared values, and includes:

0
Values are the same
<1
Value S1 comes before S2 in an alphabetic sort order
>1
Value S1 comes after S2 in an alphabetic sort order

Internally, UTF8CompareStr calls WideCompareText using the values in S1 and S2 converted to UTF-16 code points.


Version 3.2 Generated 2024-02-25 Home