[Lazarus] UTF8String and UTF8Delete
Mattias Gaertner
nc-gaertnma at netcologne.de
Fri Dec 11 14:45:55 CET 2015
On Fri, 11 Dec 2015 15:02:45 +0200
Juha Manninen <juha.manninen62 at gmail.com> wrote:
>[...]
> FYI Ondrej, having overloaded versions only for procedures taking var
> parameters makes no sense even when using DisableUTF8RTL. Lossy
> conversion would happen in every function using "String" type. Instead
> all functions must be copied and UTF8String must be used everywhere.
> The current functions make sense only with our new UTF-8 system which
> changes AnsiString encoding to UTF-8.
Without DisableUTF8RTL you can pass an UTF8String to a non "var" String
parameter. The compiler will add some checks, but they don't change the
encoding. Same for return values String to UTF8String.
With DisableUTF8RTL passing UTF8String to String changes encoding. So
every function needs an overloaded wrapper function. No need to copy
the implementation.
Mattias
More information about the Lazarus
mailing list