I asked wp for clarification of the entire statement. UTF8 is the parameter or construct that the LCL requires. (I don't know the LCL yet.) But, what memo is he addressing?
OK... LCL is the abbreviation of the "Lazarus Component Library", this is the framework behind the components which you find in the Lazarus component palette (roughly speaking). All these components (eg. a TListbox, a TMemo, a TEdit, a TLabel etc) use characters which are encoded in UTF8. UTF8 is able to display "all" characters. In UTF8 each character consists of 1 to 4 bytes. The first 128 characters, the "ASCII" characters, consist of 1 byte, their UTF8 encoding is identical to the old ASCII code.
Delphi on the other hand, uses UTF16 characters which consist of two bytes, and this results in "widestrings" or "unicodestrings" (the latter is a very confusing name because UTF8 is unicode as well...). The component library of Delphi is called VCL ("visual component library").
For writing a Lazarus program you normally do not need widestrings, only in a very few cases. Normally you can do everything with UTF8.
If you want to list the first 128 characters you can just simply add them to the lines of a TMemo or the Items of a TListbox - just because ASCII = UTF8 in this special case. If the counting variable in the for loop is an integer you must cast it to a character because the Add method wants a string (or character); or you can use a char as counting variable as well:
procedure TForm1.FormCreate(Sender: TObject);
var
ch: char;
begin
for ch:=#0 to #127 do
Listbox1.Items.Add('Char #' + IntToStr(ord(ch)) + ': ' + ch);
end;
{ or:
var
i: Integer;
begin
for i:=0 to 127 do
Listbox1.Items.Add('Char #' + IntToStr(i) + ': ' + chr(i)); // or "char(i)" instead of "chr(i)"
end;
But in your first post you had the list running up to 255 and you were referring to the Extended Ascii codes. The old DOS code page 850 used the upper half of the character byte for these characters in a standardized way. This was easy, but these old programs were not able to display "foreign" characters. In case of UTF8, i.e. Lazarus, a second byte is used to encode these characters. And you must tell Lazarus from which codepage your characters originate. In case of code page 850 you call CP850ToUTF8 to convert the old DOS characters to UTF8. This function, of course, also handle the first 128 characters correctly:
uses
LConvEncoding;
procedure TForm1.FormCreate(Sender: TObject);
var
ch: char;
begin
for ch:=#0 to #255 do
Listbox1.Items.Add('Char #' + IntToStr(ord(ch)) + ': ' + CP850ToUTF8(ch));
end;
{ or:
var
i: Integer;
begin
for i:=0 to 127 do
Listbox1.Items.Add('Char #' + IntToStr(i) + ': ' + CP850ToUTF8(chr(i))); // or "char(i)" instead of "chr(i)"
end;