//要执行保持的TStringList ConfigList //要保存到的文件名 ConfigFile //这句话是关键,确保保存后的文件是UTF-8,不是UTF-8 BOM格式 ConfigList.WriteBOM := false; ConfigList.SaveToFile( ConfigFile,TEncoding.UTF8);
参考:
https://stackoom.com/question/2BQ7s/%E5%A6%82%E4%BD%95%E5%B0%86TStringList%E7%B1%BB%E4%B8%AD%E7%9A%84%E5%AF%B9%E8%B1%A1%E4%BF%9D%E5%AD%98%E5%88%B0%E6%B2%A1%E6%9C%89BOM%E7%9A%84UTF-%E6%96%87%E4%BB%B6-Delphi-XE