On Fri, 11 Dec 2015 14:32:14 +0200 Juha Manninen <[email protected]> wrote:
> 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 := 'йäй'; The above literal requires {$codepage UTF8}. > uStr2 := uStr1; > UTF8Delete(AnsiString(Pointer(uStr2)),1,1); > ShowMessage('Original: ' + uStr1 + ', Deleted: ' + uStr2); Works here. Also on Windows. > Changing the last CharCount parameter for UTF8Delete makes no difference. Works here. > I was planning to add overloaded versions for procedures taking var > parameters in LazUTF8. Copy/pasting code may be the only way to go. Mattias -- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
