make the inifile support unicode in delphi

来源:互联网 发布:淘宝店设计多少钱 编辑:程序博客网 时间:2024/06/08 05:06

Usually, we can't write a unicode string to a normal inifile in delphi, seems not support yet.

  ini:=TIniFile.Create(filename);  ini.WriteString('mysection', 'myvar', '¿¿¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿ ¿¿¿¿¿ ¿¿¿¿¿ ¿¿¿¿¿¿¿ ');  t := ini.ReadString('mysection', 'myvar', 'default');  ini.Free;

But there's a good way to solve this problem. To code as following:

varIni:TMemIniFile;begin{...}Ini := TMemIniFile.Create('test.ini', TEncoding.UTF8);{...}end;


0 0