You must convert the read string to utf8. Another complication is that the file may begin with a BOM (byte-order-marker) which confuses the standard TStringList. Therefore, it is best to read the file into a memory stream first, extract the total string and convert it to utf8 by one of the Lazarus string converters. Use GuessEncoding to determine whether the file has a BOM or not. Note that this works also for ANSI-encoded strings.
uses
lconvencoding;
procedure ReadFileToStringList(AFilename: String; List: TStringList);
var
stream: TMemorystream;
s: String;
begin
stream := TMemoryStream.Create;
try
// Load file to memory stream
stream.LoadFromFile(AFileName);
// Put file content into a string variable
SetLength(s, stream.Size);
stream.ReadBuffer(s[1], stream.Size);
// Convert string to utf8 and assign it to stringlist
AStringList.Text := ConvertEncoding(s, GuessEncoding(s), EncodingUTF8);
finally
stream.Free;
end;
end;