Sign in Join
FPDoc Onlineexperiment

UTF8CompareStr function

In unit LazUTF8

Compares the UTF-8-encoded string values.

Declaration

pascal
function UTF8CompareStr(const S1: string; const S2: string): PtrInt

Arguments

S1

First value for the comparison.

S2

Second value for the comparison.

Function result

Relative order for the compared values.

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.

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