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 文件夹拷贝子文件及文件夹

Delphi tfilestream和tmemorystream分别读取、创建、合并文件

rightstr 返回字符串右边指定个数的新字符(串)

Delphi 提升权限查找进程关闭进程单元

Delphi 10 seattle的android应用程序中使用参数启动服务

Delphi adotable1 链接mdb数据库

Delphi excel操作,写了个adodataset转excel的函数

Delphi string.split 按照任意字符串分割语句

Delphi apihook

Delphi 获取windows系统网卡mac地址

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



打赏

取消

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

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

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

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

评论

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