[Lazarus] UTF8String and UTF8Delete

Juha Manninen juha.manninen62 at gmail.com
Sat Dec 12 18:10:59 CET 2015


On Sat, Dec 12, 2015 at 6:48 PM, Jürgen Hestermann
<juergen.hestermann at gmx.de> wrote:
> The problem is the "proper data type".

It is UnicodeString (or maybe WideString) with Windows API 'W' functions.
Everywhere else it is just String.


> In the past I used UTF8String for all my strings
> and converted to UTF-16 before feeding them into
> Windows API 'W' functions.
> That worked very well it was totally clear what happened.

That was kind of dummy thing to do because UTF8String was an alias for
AnsiString then.
You could have used "String" always.
Now UTF8String is no more an alias.


> I have now to move back to type STRING and
> somehow (did not find out yet) tell the system
> that STRING should be UTF-8 all the time.

"did not find out yet" -- it means you still did not read the wiki page. :(
Why not?


> Before FPC 3.0 everything was clear but now
> I don't know how to do it.

A valid option is to continue using FPC 2.6.4 and Lazarus 1.4.x,
especially if your SW is in maintenance mode and/or it depends very
much on system codepage in strings.

Still, in most cases our new UTF-8 system "just works".


>From earlier post:
> Why are they not assignment compatible?

This is a wrong list to ask that. The issue has been discussed and
explained many times in FPC lists during the past ~ 7 years.
Let's not start the same cycle again here.

Juha




More information about the Lazarus mailing list