delphi - How to read the INI file encoded by utf8?

I have an INI file in UTF-8 format.

I am using Delphi 2010 to read the INI file and populate a TStringGrid with the values in the INI file.

  ctr : Integer;
  AppIni : TIniFile;
  AppIni := TIniFile.Create(ExtractFilePath(Application.ExeName) + 'test.ini');
    for ctr := 1 to StringGrid1.RowCount do begin
        StringGrid1.Cells[0,ctr] := AppIni.ReadString('Column1','Row'+IntToStr(ctr),'');
        StringGrid1.Cells[1,ctr] := AppIni.ReadString('Column2','Row'+IntToStr(ctr),'');

The problem is that the unicode characters are appearing in the TStringGrid displaying 2 characters, rather than the 1 unicode character.

How do I resolve this?

This question and all comments follow the "Attribution Required."

All Answers

Answers Loading...
Leave a Reply
You must be logged in to post a answer.
About the author