Forum > General
TStringList.Sort
theo:
Try to use you own compare function. TStringList does an AnsiCompare by default.
Try this:
function UTF8Compare(List: TStringList; Index1, Index2: Integer): Integer;
begin
Result:=WideCompareStr(UTF8Decode(List[Index1]),UTF8Decode(List[Index2]));
end;
...
sl.CustomSort(@UTF8Compare);
typo:
If I implement my own sorting algorithm to the list, TStringList will still doing the task inappropriately...
theo:
Why? I'm getting this result when using the code above and your words:
andava
anos
ansiedade
antes
Antônio
ao
Aonde
aos
aparecendo
aparecer
apareceu
aparência
última
úmido
This looks quite "appropriate" to me.
typo:
Well, if you call this "appropriate"...
aparência
última
theo:
--- Quote from: typo on February 27, 2010, 11:04:41 pm ---Well, if you call this "appropriate"...
aparência
última
--- End quote ---
You should probably explain what you expect.
I can't see a problem here.
What's wrong with
aparência
última
?
Navigation
[0] Message Index
[*] Previous page