Encoding of locale-specific characters in GetAppConfigDir(False) result
Original Reporter info from Mantis: Vladimir
-
Reporter name: Vladimir Zhirov
Original Reporter info from Mantis: Vladimir
- Reporter name: Vladimir Zhirov
Description:
Under Windows, the result of GetAppConfigDir(False) is normally:
C:\Documents and Settings&LtPos;ProfileName>\Local Settings\Application Data\appname\
When launching the project from Lazarus by F9 the encoding of locale-specific characters in &LtPos;ProfileName> is different from one that is returned when launching the executable from any file manager.
The example:
-
When launching the project from Lazarus bu F9:
C:\Documents and Settings\‚« ¤Ё¬Ёа\Local Settings\Application Data\project1
Locale-specific characters seem to be encoded in CP 866 -
When launching the executable from file manager:
C:\Documents and Settings\Владимир\Local Settings\Application Data\project1
Locale-specific characters seem to be encoded in CP 1251
Additional information:
Test project source code:
program project1;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Classes,
crt, Sysutils
{ you can add units after this };
var
dir: string;
sl: TStringList;
begin
dir := GetAppConfigDir(false);
sl := TStringList.Create;
sl.Text := dir;
sl.SaveToFile('dir.txt');
sl.Free;
end.