mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-07 08:05:55 +02:00
LazUtf8: Fix Utf8Insert for StartCharIndex > Utf8Length(s)+1. Reason: consistent with System.Insert().
This commit is contained in:
parent
913b749fa9
commit
bad60c010b
@ -1194,7 +1194,9 @@ begin
|
||||
StartCharIndex := 1; //Insert() does this correction too
|
||||
StartBytePos:=UTF8CodepointStart(PChar(s),length(s),StartCharIndex-1);
|
||||
if StartBytePos <> nil then
|
||||
Insert(source, s, StartBytePos-PChar(s)+1);
|
||||
Insert(source, s, StartBytePos-PChar(s)+1)
|
||||
else
|
||||
s := s + source; // StartCharIndex > Utf8Length(s) + 1, consistent with System.Insert
|
||||
end;
|
||||
|
||||
function UTF8StringReplace(const S, OldPattern, NewPattern: String;
|
||||
|
Loading…
Reference in New Issue
Block a user