[Lazarus] Making sources compatible with Delphi (but Lazarus is priority)

Sven Barth pascaldragon at googlemail.com
Wed May 3 18:53:50 CEST 2017


Am 03.05.2017 14:37 schrieb "Tony Whyman via Lazarus" <
lazarus at lists.lazarus-ide.org>:
> On the other hand, AnsiString and UnicodeString are still separate types.
Why? Why should there not be a single unified string type with (e.g.)
ASCII, UTF8 and UTF-16 (or MS Unicode) being just another code page?

Because indexed access to the string data would slow down quite a bit as
the RTL would need to determine whether the string is a 1-Byte, 2-Byte,
4-Byte or multi Byte String. Yes the compiler could do optimizations for
this inside loops, but it would definitely slow down -O- code.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170503/2196a83c/attachment.html>


More information about the Lazarus mailing list