diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2014-06-17 23:48:18 +0100 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@gmail.com> | 2014-06-20 14:15:44 +0100 |
commit | 7751c79f7f2240e528e90d1a9023635121218d8f (patch) | |
tree | 420d31c6d41ed284be5cca7509ce2c2a6af8b513 /examples/apps/ide | |
parent | b355db06bd7f8ba79f9ba96032cf31e9d875470a (diff) | |
download | fpGUI-7751c79f7f2240e528e90d1a9023635121218d8f.tar.xz |
textedit: SaveToFile() and LoadFromFile() now does OS Encoding calls.
The AFileName parameter is of type TfpgString (thus UTF-8), and we need
to ensure that it is the same encoding as the underlying file system
before we can save or load files.
Diffstat (limited to 'examples/apps/ide')
-rw-r--r-- | examples/apps/ide/src/fpg_textedit.pas | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/apps/ide/src/fpg_textedit.pas b/examples/apps/ide/src/fpg_textedit.pas index 013ad86b..3e88f3d1 100644 --- a/examples/apps/ide/src/fpg_textedit.pas +++ b/examples/apps/ide/src/fpg_textedit.pas @@ -2412,7 +2412,7 @@ begin BuffList[I] := SLine; end; end; - BuffList.SaveToFile(AFileName); + BuffList.SaveToFile(fpgToOSEncoding(AFileName)); finally BuffList.Free; end; @@ -2423,7 +2423,7 @@ begin if not fpgFileExists(AFileName) then Exit; //==> Clear; - FLines.LoadFromFile(AFileName); + FLines.LoadFromFile(fpgToOSEncoding(AFileName)); HandleResize(Width, Height); Invalidate; end; |