Delphi TextFile UTF8编码读写


本文整理自网络,侵删。

 
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 memo 的当前行、当前列与当前字符

shellexecute的多种用法

Delphi 在listview控件中绘底图

Delphi 动态生成九宫格按钮

Delphi 在rxrichedit中插入图片的完美解决方法

Delphi xe下的fmx中压缩图片

Delphi 压缩图片(bmp、jpg、png)

Delphi 自动复制到指定目录的代码

Delphi 移除u盘的两种方法

delph hash类

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...