From 4a5e1e3cde313dd197338064586c6f305af08128 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Fri, 19 Apr 2013 13:23:54 +0100 Subject: Another file system encoding fix for TfpgINIFile - fpgApplicationName() wrapper for SyUtils.ApplicationName - TfpgINIFile reference ApplicationName, instead of fpgApplicationName - In TfpgINIFile we forgot to encode the file name back to the system encoding before we called Create(). --- src/corelib/fpg_utils.pas | 6 ++++++ src/gui/fpg_iniutils.pas | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/corelib/fpg_utils.pas b/src/corelib/fpg_utils.pas index 9d0e907d..50167276 100644 --- a/src/corelib/fpg_utils.pas +++ b/src/corelib/fpg_utils.pas @@ -51,6 +51,7 @@ function fpgIsBitSet(const AData: integer; const AIndex: integer): boolean; // RTL wrapper filesystem functions with platform independant encoding // These functions are common for all platforms and rely on fpgXXXPlatformEncoding +function fpgApplicationName: TfpgString; function fpgFindFirst(const Path: TfpgString; Attr: longint; out Rslt: TSearchRec): longint; function fpgFindNext(var Rslt: TSearchRec): longint; function fpgGetCurrentDir: TfpgString; @@ -101,6 +102,11 @@ begin Result := ALine; end; +function fpgApplicationName: TfpgString; +begin + Result := fpgFromOSEncoding(ApplicationName); +end; + function fpgFindFirst(const Path: TfpgString; Attr: longint; out Rslt: TSearchRec): longint; begin Result := FindFirst(fpgToOSEncoding(Path), Attr, Rslt); diff --git a/src/gui/fpg_iniutils.pas b/src/gui/fpg_iniutils.pas index 36eb8bff..6bbe83bd 100644 --- a/src/gui/fpg_iniutils.pas +++ b/src/gui/fpg_iniutils.pas @@ -90,12 +90,12 @@ begin if lFileName = '' then - lFileName := ApplicationName + '.ini' + lFileName := fpgApplicationName + '.ini' else if fpgExtractFileExt(lFileName) = '' then lFileName := lFileName + '.ini'; lFileName := lDir + lFileName; - Create(lFileName); + Create(fpgToOSEncoding(lFileName)); end; function TfpgINIFile.ReadString(const ASection, AIdent, ADefault: string): string; -- cgit v1.2.3-70-g09d2