[Lazarus] UTF8String and UTF8Delete

Ondrej Pokorny lazarus at kluug.net
Thu Dec 10 19:18:45 CET 2015


On 10.12.2015 18:36, Juha Manninen wrote:
> On Thu, Dec 10, 2015 at 7:29 PM, Jürgen Hestermann
> <juergen.hestermann at gmx.de> wrote:
>> Then why does the compiler complain when I
>> feed UTF8Delete with an UTF8String?
> As it told you. It got UTF8String but expected AnsiString. I think it
> would work with a typecast but that is quite useless. Just use a
> String instead.
> In fact the Unicode support is now almost Delphi compatible at source
> level. Only code that depends on system codepage needs special
> attention.

What if I compile my application with DisableUTF8RTL or (in the future) 
I compile with String=UnicodeString (utf-16) and I still need to use 
UTF8String with UTF8* functions (e.g. because an external library uses it)?

IMO, there should be overloaded versions for UTF8* functions that 
explicitely accept UTF8String.
Or am I wrong?

Ondrej




More information about the Lazarus mailing list