[Lazarus] String vs WideString

Michael Schnell mschnell at lumino.de
Mon Aug 14 10:25:14 CEST 2017


On 13.08.2017 22:41, Juha Manninen via Lazarus wrote:
> You have misused "String" or "AnsiString" from the beginning for binary data.
> There have always been warnings against it.
While this might be true, it's decently silly, IMHO.

The name "String" can easily be interpreted as "String of things" and 
does not necessarily mean "String of printable stuff".

The management Pascal always provided for strings (after the "Short 
String" was not the only string type) (i.e. Operators, built-in 
functions, lazy copy, reference counting) is perfectly applicable to 
"Strings of things", and don't force any known encoding at all.

The drama only was introduced by Embarcadero's abysmal / sloppy 
implementation of automatic code conversion for strings.

-Michael


More information about the Lazarus mailing list