[fpc-devel] new string - question on usage
Hans-Peter Diettrich
DrDiettrich1 at aol.com
Wed Oct 12 13:38:09 CEST 2011
Marco van de Voort schrieb:
> In our previous episode, Hans-Peter Diettrich said:
>>> Please explain what you mean by "unicode" and what by "ansi" in your
>>> statement. Without nuancing that, your statement is pretty much meaning
>>> less.
>> AFAIR Delphi changed the string type to Unicode (UTF-16) in D2009, i.e.
>> D2007 was the last Ansi version.
>
> Point I was trying to make is that in D2009+ ansistring includes utf8 which
> is also unicode. Therefore the term "unicode" is ambiguous. If you mean
> the two byte type say utf16 or 2-byte type.
Point taken.
UTF-16 strings already existed in the old (Ansi) versions, as
WideString. The new string=UnicodeString is a reference counted type,
and at the same time AnsiString was extended by a stored encoding and
element size. The StrRec record, prefixed to the string data, is the
same for AnsiString and UnicodeString, different from the old AnsiString
header. All new string types are strict, not alias. I mean all these
subtle differences, when talking about Ansi and Unicode *versions* of
Delphi.
DoDi
More information about the fpc-devel
mailing list