Apologies for the long silence. I've had to dig deeper into this issue and I admit it is confusing.
First and foremost, here are the settings I'm using across all my packages. Maybe these are wrong but that's what I was able to get from reading about unicode...
{$modeswitch UnicodeStrings}
{$codepage utf-8}
Now, concerning TStrings and TStringList, they use code which is specific to ansistring.
For instance:
TStrings.DoCompareText, found on line 878 of stringl.inc, relies on the non-unicode function
CompareText. Now this method in turn is found on line 176 of sysstr.inc. As far as I can tell, and I can be wrong it relies on the following critical comparison:
Chr1 := byte(p1^);
Chr2 := byte(p2^);
I fail to see how this would work in a unicode setting.
Furthermore, that same method is overriden in TStringList as follows:
function TStringList.DoCompareText(const s1, s2: string): PtrInt;
begin
if FCaseSensitive then
result:=AnsiCompareStr(s1,s2)
else
result:=AnsiCompareText(s1,s2);
end;
Again, I fail to see how this code would work with unicode strings.
Lastly, I just found out that on Windows, AnsiCompareStr is actually broken. You can see that from another post of mine:
http://forum.lazarus.freepascal.org/index.php/topic,37926.msg256327.html#msg256327Do to all of these issues, I've written a drop-compatible replacement of TStringList that supports Unicode from the ground up.
If anyone is interested, I'd be happy to share this code with you.