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 在tmemo中查找文本

Delphi 中的包开发

Delphi中通过tclientsocket获取公网(wan)ip地址

Delphi 2009 泛型容器单元(generics.collections)[4]: tdictionary<t>

Delphi 通过memorystream 传递image1数据

Delphi md5加密算法

Delphi 动态生成进度条窗体

Delphi findfiles获取目录下所有文件

Delphi 用firedac获取 sql server错误文本信息

pe结构详细图

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



打赏

取消

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

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

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

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

评论

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