Hi friends,
I'm loading an ANSI TXT file into a TStringList and want to show some data in a TEdit. I have some extended ASCII chars into the file, but TEdit doesn't show these chars, even if I try converting it using AnsiToUtf8.
I wrote this short code to show what happens:
SetLength(Str,50);
AssignFile(FileVar,'teste2.txt');
Reset(FileVar,47);
Seek(FileVar,2);
BlockRead(FileVar,Buf,1);
for c := 1 to 47 do
Str[c] := Chr(Buf[c]);
Label1.Caption := AnsiToUTF8(Str);
CloseFile(FileVar);
The character 'ã' are shown as '?'. If I don't use AnsiToUTF8, just shows a crossed block.
What should be the right way to do it?
The file 'teste2.txt' follows attached.