summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2013-04-19 13:23:54 +0100
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2013-04-19 13:25:07 +0100
commit4a5e1e3cde313dd197338064586c6f305af08128 (patch)
treed18aa484b189ea1deebee92b30ae8e17d05938f7 /src
parent7c05425017f7a3722765a204d98856d53f90f096 (diff)
downloadfpGUI-4a5e1e3cde313dd197338064586c6f305af08128.tar.xz
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().
Diffstat (limited to 'src')
-rw-r--r--src/corelib/fpg_utils.pas6
-rw-r--r--src/gui/fpg_iniutils.pas4
2 files changed, 8 insertions, 2 deletions
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;