Reputation: 1843
I have written some code:
MnemonicList := TStringList.Create();
{$IFDEF Android}
IniPath := TPath.Combine(TPath.GetDocumentsPath, ADefaultLanguage + '.ini'); { Internal }
{$ENDIF}
{$IFDEF Win32}
IniPath := TPath.Combine(ExtractFilePath(ParamStr(0)), 'Lang\' + ADefaultLanguage + '.ini');
{$ENDIF}
if FileExists(IniPath) then
begin
MemIniFile := TMemIniFile.Create(IniPath);
ShowMessage(IniPath);
MemIniFile.ReadSections(MnemonicList);
ShowMessage(IntToStr(MnemonicList.Count));
end;
The second ShowMessage() results with 4 when runs on Windows and 0 when runs on Android... File is populated correctly and FileExists(IniPath) gives True also on Android. I can open files on Android and Windows in editor as well. Are there any differences on TMemIniFile on Android?
Upvotes: 0
Views: 468
Reputation: 1843
There was a problem with INI file characters encoding. When I changed to UTF-8 w/o BOM it started to work.
Upvotes: 1