mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-21 14:39:27 +02:00
LazUtils: Second attempt to implement Utf8Delete() for parameters of type Utf8String.
git-svn-id: trunk@50910 -
This commit is contained in:
parent
6c409b1ecc
commit
894c125543
@ -898,17 +898,18 @@ procedure UTF8Delete(var s: Utf8String; StartCharIndex, CharCount: PtrInt);
|
||||
var
|
||||
tmp: String;
|
||||
begin
|
||||
{$IFDEF ACP_RTL}
|
||||
tmp := RawByteString(s);
|
||||
{.$IFDEF ACP_RTL}
|
||||
{ change code page without converting the data }
|
||||
SetCodePage(RawByteString(tmp), CP_UTF8, False);
|
||||
{$ENDIF}
|
||||
tmp := s;
|
||||
{.$ENDIF}
|
||||
{ keep refcount to 1 if it was 1, to avoid unnecessary copies }
|
||||
s := '';
|
||||
UTF8Delete(tmp,StartCharIndex,CharCount);
|
||||
{ same as above }
|
||||
s := tmp;
|
||||
s := RawByteString(tmp);
|
||||
tmp := '';
|
||||
SetCodePage(RawByteString(s), CP_UTF8, False);
|
||||
end;
|
||||
{$ENDIF NO_ACP_RTL}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user