lazutils: added UTF8CompareStrCollated

git-svn-id: trunk@40228 -
This commit is contained in:
mattias 2013-02-09 20:45:24 +00:00
parent ada0f52f3c
commit 043dd66828
2 changed files with 13 additions and 1 deletions

View File

@ -91,6 +91,7 @@ function UTF8CompareStr(const S1, S2: string): Integer; inline;
function UTF8CompareStrP(S1, S2: PChar): Integer;
function UTF8CompareStr(S1: PChar; Count1: SizeInt; S2: PChar; Count2: SizeInt): Integer;
function UTF8CompareText(const S1, S2: string): Integer;
function UTF8CompareStrCollated(const S1, S2: string): Integer;
function CompareStrListUTF8LowerCase(List: TStringList; Index1, Index2: Integer): Integer;
type
@ -2579,6 +2580,15 @@ begin
Result := UTF8CompareStr(S1Lower, S2Lower);
end;
function UTF8CompareStrCollated(const S1, S2: string): Integer;
begin
{$IFDEF MSWINDOWS}
Result := AnsiCompareStr(UTF8ToSys(S1), UTF8ToSys(S2));
{$ELSE}
Result := WideCompareStr(S1, S2);
{$ENDIF}
end;
function CompareStrListUTF8LowerCase(List: TStringList; Index1, Index2: Integer
): Integer;
begin

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0"?>
<fpdoc-descriptions>
<package name="lazutils">
<!--
@ -730,6 +730,8 @@ Control characters are the unicode sets C0 and C1 and the left-to-right and righ
<element name="UTF8PosP"><short>Returns the position where SearchInText starts in SearchForText</short><descr>If not found it returns nil.
Null characters #0 are treated as normal characters.</descr>
</element>
<element name="UTF8CompareStrCollated"><short>Compare two strings using language specific sorting</short>
</element>
</module>
<!-- LazUTF8 -->
</package>