[Lazarus] TStringList.LoadFromFile encoding parameter
Martin Schreiber
mse00000 at gmail.com
Sun Jul 10 07:20:20 CEST 2016
On Saturday 09 July 2016 18:16:51 Michael Van Canneyt wrote:
> > I see now that FPC's TEncoding uses UnicodeString and PUnicodeChar. For
> > me it's a strange decision. I would expect it to be String (
> > http://wiki.freepascal.org/Character_and_string_types#String ) and use
> > UTF8 since AnsiString(CP_UTF8) is compatible to String.
>
> AFAIK It is Delphi compatible, and there it is unicodestring (well,
> widestring).
>
Actually "UnicodeString". "WideString" is something other on Windows.
I suggest that if we use the the word "widestring" in context of Free Pascal
we explain that we mean the type "UnicodeString". One can often
read "WideString" instead of "UnicodeString" in Free Pascal Unicode example
code which is not optimal.
We always can write that "UnicodeString" is the wrong name for a reference
counted utf-16 string because UTF8String or AnsiString with default code page
set to utf-8 also is Unicode in order to express our anger about the bad
marketing driven decision of the Delphi owners. ;-)
Martin
More information about the Lazarus
mailing list