频道分类

Delphi TextFile UTF8编码读写

作者:admin 来源: 日期:2020/12/1 19:09:39 人气: 标签:

 
procedure TForm1.Button1Click(Sender: TObject);
var
  Outfile: TextFile;
begin
  AssignFile(Outfile, 'test_chinese.txt', CP_UTF8);
  Rewrite(Outfile);

  //This is the UTF-8 BOM
  Write(Outfile, #$FEFF);

  Writeln(Outfile, '总结');
  Writeln(Outfile, '°C');
  CloseFile(Outfile);
end;

上一篇:Delphi DateTimePicker控件日期格式下一篇:没有资料