Hello,
I'm a Delphi developer and explore prospects to port to Lazarus.
I have no urgent need, I'm occupied with other things, but still,
I'm puzzled each time I look here. FPC strategy is fortunately
already defined (Delphi string compatible), but what is with Lazarus?
I don't understand, why Lazarus would not define the strings as follows:
1) Utf8-strings via Utf8String (and shorter alias).
2) Utf16-strings via UnicodeString and String (Delphi compatible).
3) Acp-strings via Ansistring (and shorter alias).
This means all encodings are declared at compiletime,
the best we could reach. As a consequence, libraries from
different authors, different platforms, would be compatible.
All apis (FPC and LCL) preferrably have method-parameter overloads
with Rawbytestring, Utf8String (if Rawbytestring version is absent), UnicodeString.
This minimizes the implicit conversions before method-calls.
I don't understand where the opposition comes from.
Currently, in Lazarus1.6, "String" is used for utf8 (via acp ansistring,
inclusive conflicts by defaultcodepage change, differences in libraries,
systems with other codepage).
But "String" could be easily renamed to Utf8String, because both are data equivalent.
Is this the origin of the problem, Lazarus users still want "String",
regardless of the encoding behind it, regardless of differences
in usage (eg. character access to utf8 and utf16) ?