mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 18:58:04 +02:00
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:
parent
2228fcd9a2
commit
d967200792
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user