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

UTF8CompareText

Case-insensitive comparison of two UTF-8-encoded values.

Declaration

Source position: lazutf8.pas line 177

function UTF8CompareText(

  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

UTF8CompareText is a function used to perform a case-insensitive comparison between the specified UTF-8-encoded values. The return value indicates the relative sort order for the compared values, and includes:

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

Internally, UTF8CompareText uses WideCompareText when multi-byte codepoints are found in the compared values. This function guarantees proper collation on all supported platforms.


Version 3.2 Generated 2024-02-25 Home