Am 28.02.2014 09:37 schrieb "Michael Schnell" <mschn...@lumino.de>:
>
> ..Continuing the never ending discussion ...
>
> [ In one ore more other threads here I showed that (IMHO) it would be
most sensible (and in fact not performance killing (!) ) way out of the
multiple (statically defined) "new" String types with different encoding
(with auto-conversion) to additionally support a fully dynamically encoded
string type (with auto-conversion) - which needs some compiler magic - and
use same as the base type for TStrings and it's siblings. ]
>
> The growing popularity of "Generics" might suggest to call this String
encoding "Generic", too, (to easily tell it from the Delphi-introduced
"Raw", and the dedicated encoding types).
>
> Regarding arguments for it's usefulness I came across that the Lazarus
API currently forces TStrings to be UTF8 encoded while Delphi currently
forces TStrings to be UTF16 encoded. IMHO the only way to prevent
disastrous compatibility problems is to do TStrings being "Generic"encoded
and with that allow for decent portability for both.

Problem: there is (currently) no string type that can handle ANSI, UTF-8
and UTF-16 at once. The first two are handled by AnsiString and the third
by UnicodeString. And those two are not equal which would be important for
overrides/overloads/inheritance. Without that your whole idea is useless.

Regards,
Sven
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to