[Lazarus] UTF8 string compare with correct locale sorting

Michael Schnell mschnell at lumino.de
Tue Oct 22 09:37:52 CEST 2013


On 10/21/2013 07:12 PM, Jy V wrote:
>
> it may require the user to provide 1 additional parameter to compare 2 
> strings
> it should not be that difficult to use.

Yep.

Only that traditional Pascal programmers are not used to do

if compareUTF8String(s1, s2, comparemode) < 0 then ...

but

if s1 < s2 then ....


Thus Delphi and FPC introduce quasi-dynamically encoded Strings with 
automatic encoding-type handling.

Unexpected compare-results are hardly avoidable here :-( .

-Michael




More information about the Lazarus mailing list