How can a text file be converted from ANSI to UTF-8 with Delphi 7?

后端 未结 6 1646
渐次进展
渐次进展 2021-01-11 18:48

I written a program with Delphi 7 which searches *.srt files on a hard drive. This program lists the path and name of these files in a memo. Now I need convert

6条回答
  •  抹茶落季
    2021-01-11 19:15

    I did only this:

    procedure TForm1.FormCreate(Sender: TObject);
    begin
      Strings := TStringList.Create;
    end;  
    
    procedure TForm1.Button3Click(Sender: TObject);
    begin
       Strings.Text := UTF8Encode(Memo1.Text);
       Strings.SaveToFile('new.txt');
    end;
    

    Verified with Notepad++ UTF8 without BOM

提交回复
热议问题