[Lazarus] String vs WideString

Sven Barth pascaldragon at googlemail.com
Wed Aug 16 19:35:23 CEST 2017


On 16.08.2017 11:08, Graeme Geldenhuys via Lazarus wrote:
> On 2017-08-16 09:43, Michael Schnell via Lazarus wrote:
>> IMHO, any implementation of TStrings that forces a conversion (just
>> because the class uses TStrings and not due to a logical demand), is a
>> contradiction to providing code aware strings at all.
> 
> But in FPC 3.x (using modern compiler modes - not TP or Mac) String =
> UnicodeString. So it makes sense that TStrings should use UnicodeString
> internally to store its data. The Unicode standard is also the only
> standard that can support any language. So all Windows code-pages can be
> supported with the single UnicodeString type.

You are wrong. The string types in 3.0.x and 3.1 are like this:

TP, Iso, ExtPas, MacPas, FPC, ObjFPC (or below modes with $H-): String =
ShortString
Delphi (or other modes with $H+): String = AnsiString (or more precisely
String(CP_ACP), meaning the system codepage)
Delphi_Unicode (or other modes with $H+ and $modeswitch unicodestring):
String = UnicodeString

Regards,
Sven


More information about the Lazarus mailing list