On Fri, Dec 11, 2015 at 2:12 PM, Mattias Gaertner
<[email protected]> wrote:
> On Fri, 11 Dec 2015 08:05:12 +0100
> Sven Barth <[email protected]> wrote:
>> Also I doubt that you can do this for var parameters...
>
> FPC 3.0 eats it without a hint.
It does not work though. Interesting.
Using the new default UTF-8 system for LCL apps and FPC 3.0 on Linux,
this works :
var
uStr1, uStr2: String;
begin
uStr1 := 'йäй';
uStr2 := uStr1;
UTF8Delete(uStr2,1,1);
ShowMessage('Original: ' + uStr1 + ', Deleted: ' + uStr2);
but this shows garbage :
var
uStr1, uStr2: UTF8String;
begin
uStr1 := 'йäй';
uStr2 := uStr1;
UTF8Delete(AnsiString(Pointer(uStr2)),1,1);
ShowMessage('Original: ' + uStr1 + ', Deleted: ' + uStr2);
Changing the last CharCount parameter for UTF8Delete makes no difference.
I was planning to add overloaded versions for procedures taking var
parameters in LazUTF8. Copy/pasting code may be the only way to go.
Juha
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus