[Lazarus] UTF8String and UTF8Delete

Sven Barth pascaldragon at googlemail.com
Fri Dec 11 19:07:44 CET 2015


On 11.12.2015 15:14, Juha Manninen wrote:
> On Fri, Dec 11, 2015 at 4:10 PM, Mattias Gaertner
> <nc-gaertnma at netcologne.de> wrote:
>> The job of the wrapper is to convert to type String without
>> triggering the conversion of the content.
>
> Ok, lots of ugly Pointer typecasts. Doable, yes.
>

Not necessarily. You can use SetCodePage() to change the code page of 
the string without triggering a codepage conversion by using the third 
parameter which is a Boolean that tells the function to either do a 
conversion (True; default) or not (False). You'd then need to declare 
the UTF8* routines as RawByteString and explicitly handle the type 
conversion.

That's at least more officially supported than ugly pointer typecasts...

(Note: it might be that some details don't work as I described them; if 
in doubt ask on fpc-pascal please)

Regards,
Sven





More information about the Lazarus mailing list