Skip to content

Commit

Permalink
Always read portable settings file and imported settings file in UTF8…
Browse files Browse the repository at this point in the history
… mode, instead of (falsely) auto-detecting the encoding. Fixes broken characters loaded from a portable file larger than the examined 16 (?) KB. See pm from FP.
  • Loading branch information
ansgarbecker committed Mar 3, 2021
1 parent 5204ac5 commit 3e7a706
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/apphelpers.pas
Expand Up @@ -4111,7 +4111,7 @@ procedure TAppSettings.ImportSettings(Filename: String);
raise Exception.CreateFmt('File does not exist: %s', [Filename]);
end;

Content := ReadTextfile(FileName, nil);
Content := ReadTextfile(FileName, UTF8NoBOMEncoding);
Lines := Explode(CRLF, Content);
for i:=0 to Lines.Count-1 do begin
// Each line has 3 segments: reg path | data type | value. Continue if explode finds less or more than 3.
Expand Down

0 comments on commit 3e7a706

Please sign in to comment.