you are repeatedly spreading the bad practice with the String (=ansistring). The generic String has not the same meaning everywhere (in new Delphi is UnicodeString, in old Delphi acp-ansistring, in Lazarus also utf8-ansistring).
... and why is the "utf8-ansistring" meaning a bad practice but the others are not?
Earlier I wrote that "String" type is Delphi compatible at
source level. Yes, it is amazingly compatible considering the different encodings.
Modules (thirdparty) with different meanings of String cannot be simply combined, errors would occur (due to missing or wrong conversions).
Those modules must match the string type used in LCL / LazUtils obviously.
They can also continue to use the old Ansi codepage encoding + explicit UTF-8 conversion functions by defining DisableUTF8RTL and forcing their applications to define it, too.
We created the DisableUTF8RTL system so that everybody can be happy and nobody has reasons to complain. Still some people complain. Why? I believe they did not actually test the system and they misunderstood something.
Not only compiletime is the problem, the meaning of String (ansistring) can change at runtime by assignments or calls of SetMultiByteConversionCodePage.
Our UTF-8 system calls SetMultiByteConversionCodePage. Obviously it should not be called again.
Yet, if somebody wants to call it and create his own non-standard string encoding, he can define DisableUTF8RTL and the system is pretty much like it used to be.
This is also the reason, why professional devs, like in Synopse mORMot,
use their own types, with codepage fixed at compiletime, or others use only UnicodeString (String in new Delphi).
If mORMot uses an own string type, it should be easy to map to our "String" or anything else. What is the problem?
If they have real problems when porting, we can help.
The correct solution is UnicodeString and Utf8String. Or better, use shorter aliases for them.
I have seen this suggestion before but I don't quite understand how anybody can propose it seriously. It would require every developer to change all their string types in all their code.
Not very realistic.
Do you remember how much effort Delphi made to preserve the backwards compatible "String" when they switched to UTF-16? They broke lots of code but still the changes were reasonable compared to changing every "String" to something else.
Our system breaks much less code yet it is amazingly Delphi compatible. What more, it is a huge improvement over the old UTF-8 hack with explicit conversions functions.
My guess is that you did not even try the new Lazarus UTF-8 system before complaining. Please try!