|
@@ -610,17 +610,16 @@ Var
|
|
|
|
|
|
function NameUtf8CodePointLen(index: longint): longint;
|
|
function NameUtf8CodePointLen(index: longint): longint;
|
|
var
|
|
var
|
|
- MaxLookAhead,
|
|
|
|
- CodePointLen: longint;
|
|
|
|
|
|
+ MaxLookAhead: longint;
|
|
begin
|
|
begin
|
|
MaxLookAhead:=LenName-Index+1;
|
|
MaxLookAhead:=LenName-Index+1;
|
|
{ abs so that in case of an invalid sequence, we count this as one
|
|
{ abs so that in case of an invalid sequence, we count this as one
|
|
codepoint }
|
|
codepoint }
|
|
- CodePointLen:=abs(Utf8CodePointLen(pansichar(@Name[index]),MaxLookAhead,true));
|
|
|
|
|
|
+ NameUtf8CodePointLen:=abs(Utf8CodePointLen(pansichar(@Name[index]),MaxLookAhead,true));
|
|
{ if the sequence was incomplete, use the incomplete sequence as
|
|
{ if the sequence was incomplete, use the incomplete sequence as
|
|
codepoint }
|
|
codepoint }
|
|
- if CodePointLen=0 then
|
|
|
|
- CodePointLen:=MaxLookAhead;
|
|
|
|
|
|
+ if NameUtf8CodePointLen=0 then
|
|
|
|
+ NameUtf8CodePointLen:=MaxLookAhead;
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure GoToLastByteOfUtf8CodePoint(var j: longint);
|
|
procedure GoToLastByteOfUtf8CodePoint(var j: longint);
|