So, I've read these pages again and I hope I understood this right.
Here's a sample program I wrote, based on what I thought I read in these pages...
program Project1;
Uses LazUTF8, Classes;
Var SL : TStringList;
begin
SL := TStringList.Create;
With Sl do
begin
Sorted := true;
CaseSensitive := True;
Add('Garçon' );
Add('Èternuer');
Add('éternuer');
Add('B');
Add('a');
//Next line does not compile
//Add(StringOfChar('ö', 5));
end;
Writeln('1: ' , SL[0]);
Writeln('2: ' , SL[1]);
Writeln('3: ' , SL[2]);
Writeln('4: ' , SL[3]);
Writeln('5: ' , SL[4]);
readln;
SL.Free;
end.
When I run this code, I get the following output:
1: a
2: B
3: éternuer
4: Eternuer
5: Garçon
Three things to note:
- Is 'a' supposed to be less than 'B'? In the ascii table, 'a' is greater than 'B'. Am I forgetting to switch to the right code page?
- The accent on the upper E is missing... it should be É but I get back E.
- StringOfChar seems to be hardcoded to ansiChar and it does not seem to switch to unicode. In fact, if you uncomment the one commented line of code, you'll get a compiler error.
Now, when I run the code I wrote with the drop in replacement for TStringList, I get the following (correct) output:
1: Garçon
2: Éternuer
3: B
4: éternuer
5: ööööö
6: a
Perhaps I'm still not understanding what the pages you referenced really meant to do, so, please help correct this sample program.