On Thu, 26 Dec 2019 16:15:03 +0100
Ondrej Pokorny <laza...@kluug.net> wrote:

> Hello,
> 
> a lot of people have a problem with the TStrings.LoadFrom*() changes 
> when TEncoding support was added.
> 
> Currently, the no-encoding overloads of TStrings.LoadFrom*() and 
> TStrings.SaveTo*() use the TEncoding.Default, which is WIN-ANSI and
> not DefaultSystemCodePage.

It seems FPC 3.3.1 does use DefaultSystemCodePage:

class function TEncoding.GetANSI: TEncoding;
begin
  ....
    if not Assigned(FStandardEncodings[seAnsi]) then
    begin
      // DefaultSystemCodePage can be set to non-ANSI
      if Assigned(widestringmanager.GetStandardCodePageProc) then
        FStandardEncodings[seAnsi] := 
TMBCSEncoding.Create(widestringmanager.GetStandardCodePageProc(scpAnsi))
      else
        FStandardEncodings[seAnsi] := 
TMBCSEncoding.Create(DefaultSystemCodePage);
   ...
end;

Maybe you are querying TEncoding.Default before changing
DefaultSystemCodePage?


Mattias
 
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to