IDE: When reading lazarus.cfg file, change from Windows codepage to UTF8 when needed (the file is written by the Windows installer). Fixes Issue #0029494.

git-svn-id: trunk@53047 -
This commit is contained in:
bart 2016-09-28 14:09:32 +00:00
parent 2228fcd9a2
commit d967200792

View File

@ -127,7 +127,15 @@ begin
for i := 0 to Cfg.Count - 1 do begin
s := Cfg[i];
if (s <> '') and (s[1] = '-') then
ParamsAndCfgFileContent.Add(Trim(Cfg[i]))
begin
s := Trim(s);
{$ifdef windows}
//cfg file is made by Windows installer and probably is Windows default codepage
if FindInvalidUTF8Character(PChar(s), Length(s), True) > 0 then
s := WinCPToUtf8(s);
{$endif windows}
ParamsAndCfgFileContent.Add(s)
end
else
if (Trim(s) <> '') and (s[1] <> '#') then
Warn := Warn + IntToStr(i)+': ' + s + LineEnding;