I am trying to save a string to one ini file with UTF-8 format. I want to edit one of the string values but I am unable to.
Can somebody help by providing an example?
Source: test.ini; DestDir: {app};
[INI]
Filename: {app}\test.ini; Section: testclient; Key: PlayerName; String: "{code:GetUserName}";
procedure InitializeWizard();
var
NameEdit: TNewEdit;
function GetUserName(Param: String): string;
begin
result := NameEdit.Text;
end;
procedure InitializeWizard0();
begin
PlayerSettingsPage := CreateCustomPage(wpSelectComponents, 'Test', '');
NameEdit := TNewEdit.Create(WizardForm);
NameEdit.Parent := PlayerSettingsPage.Surface;
NameEdit.Left := 25;
NameEdit.Top := NameLabel.Top + 43;
NameEdit.Width := 130;
NameEdit.Text :='Enter your Pla';
end;
Its neccesary to save the ini in UTF-8 because the software I am using only accepts an ini file with UTF-8 format.
If the ini am using to be edited, is in ansi format, will not save properly the unicode fonts, will show only this: ?????, and if the ini was in unicode [UTF-16LE] the ini show the unicode characters properly, but when the game load it will not show them.
Then if the ini am using to be edited is in UTF-8 format, the inno setup do not save the text properly in it. Then i saw in the internet that inno setup have a special code to do it but i do not know how to use it good.
SaveStringsToUTF8File
Am using Inno Setup Unicode.