mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 12:39:29 +02:00
LazUtf8: correct a StartCharIndex < 1 in Utf8Copy. Reason: consistent with System.Copy().
This commit is contained in:
parent
c0f4946828
commit
162cbbfc1b
@ -1125,6 +1125,8 @@ var
|
||||
EndBytePos: PChar;
|
||||
MaxBytes: PtrInt;
|
||||
begin
|
||||
if StartCharIndex < 1 then
|
||||
StartCharIndex := 1; //Copy() does this correction too
|
||||
StartBytePos:=UTF8CodepointStart(PChar(s),length(s),StartCharIndex-1);
|
||||
if StartBytePos=nil then
|
||||
Result:=''
|
||||
|
Loading…
Reference in New Issue
Block a user