Was the bug in StrCmpLogicalW only for the combination alpha/numeric or is the bug also present with just sorting letters?
And I'm not sure if CompareString-api (Windows) and strcoll (Linux) handle the ordering the same. (we should test that before using that api) Otherwise the function should just sort in pascal after querying the Locale (which is probably not easy to do).
What do you consider the right order (1 or 2)?
1) e1 é1 e2 é2
2) e1 e2 é1 é2
(I think CompareString sees 1 as correct, which would be according to linguistic rules, so é en e are equal)
Also... I saw in lazutf8.pas a function UTF8CompareStrCollated. It calls AnsiCompareStr for Windows (which should/could be locale-aware) but calls WideCompareStr for Linux (which I don't think is locale-aware). So in Linux it does not do as advertised.
Edit: Oo, wait
" result:=wcscoll(pwchar_t(hs1),pwchar_t(hs2)); "
It is locale aware in Linux (see the wcscoll, unicode aware locale-sort)
So you can just use UTF8CompareStrCollated for the text-part and you're good to go in Linux and Windows
(You just need to write the splitter and comparer)