In it, it mentions that the TStringListUTF8 will be merged into the regular TStringList.
Before I created this thread I completely forgot abut that!!
And I think that if I used TStringListUTF8 to begin with, I would not see this different behaviour.
TStringListUTF8 does not exist in LazUtils or other Lazarus sources any more. It was needed a long time ago when FPC did not have dynamic codepages.
Now you get full Unicode support with TStringList.
LazUtils has TStringListUTF8Fast which is an optimization for use cases that most often have pure ASCII but can have non-ASCII sometimes.
Lazarus IDE has many such cases. Pascal identifiers, directory names for FPC and Lazarus sources etc.
TStringList has 2 properties that affect comparison and sorting, namely CaseSensitive and UseLocale.
By default CaseSensitive=False and UseLocale=True. Then the super-slow AnsiCompareText() is used for comparison.
It means TStringList is a potential trap, code can become very slow without a programmer realizing the reason.
Setting CaseSensitive:=True makes it already faster although you may still get different order in different locales.
The different order is not related to UTF8 encoding. It is related to the complex Unicode rules. WideStringManager on Windows uses the system's UTF16 encoding.