[fpc-devel] TEncoding.Default and default encoding for TStrings.LoadFrom*()
Ondrej Pokorny
lazarus at kluug.net
Fri Dec 27 12:01:24 CET 2019
On 27.12.2019 10:40, Michael Van Canneyt wrote:
>> Yes, indeed. Therefore I suggested
>> * TEncoding.Default for the DefaultSystemCodePage variable
>> and
>> * TEncoding.ANSI for the system encoding.
>>
>> Currently we have
>> * TEncoding.SystemEncoding for the DefaultSystemCodePage variable
>> and
>> * both TEncoding.ANSI and TEncoding.Default for the system encoding.
>> (TEncoding.ANSI and TEncoding.Default are equal in FPC.)
>
> In that case, why not simply change:
>
> class function TEncoding.GetDefault: TEncoding;
> begin
> Result := GetSystemEncoding;
> end;
>
> Nothing need be removed. I consider SystemEncoding a better name than
> Default,
> and the latter should only be kept for Delphi compatibility. IMHO it
> would be
> better to avoid Default, in fact I would change references to Default to
> SystemEncoding for clarity. Default is completely non-descriptive.
>
> If I understand your reasoning correct, that should solve the problems
> you
> report ?
Yes, that perfectly solves the issues Lazarus developers and users face.
I am OK with this solution as well. Thanks!
Ondrej
More information about the fpc-devel
mailing list