[fpc-pascal] Generic String Functions

Marco van de Voort marcov at stack.nl
Fri Feb 28 13:04:41 CET 2014


In our previous episode, Sven Barth said:
> 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.

Moreover, will operations that use character access make sense at all if you
don't know what the actual encoding is? (not only s[] but also
pos,delete,insert etc).   The same code can seem to behave differently
because different code-paths make the same parameter have different
encodings.

It will require a "forceencoding()" function etc, which is incompatible with
all current stringcode, and frustrate the general no conversion spirit which
is the main advantage.

And of course it is totally incompatible with Delphi.



More information about the fpc-pascal mailing list