mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 14:39:20 +02:00
lazreport: fixed UTF8Desc to always return a valid UTF8 string
git-svn-id: trunk@47750 -
This commit is contained in:
parent
69edc4d8c0
commit
d85758cb35
@ -920,19 +920,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function UTF8Desc(S: string; var Desc: string): Integer;
|
function UTF8Desc(S: string; var Desc: string): Integer;
|
||||||
var
|
|
||||||
i,b: Integer;
|
|
||||||
begin
|
begin
|
||||||
i := 1;
|
Desc:=S;
|
||||||
Result := 0;
|
UTF8FixBroken(Desc);
|
||||||
SetLength(Desc, Length(S));
|
Result:=length(Desc);
|
||||||
while i<=Length(s) do begin
|
|
||||||
b := UTF8CharacterStrictLength(@S[i]);
|
|
||||||
inc(i,b);
|
|
||||||
inc(Result);
|
|
||||||
Desc[Result] := Char(b);
|
|
||||||
end;
|
|
||||||
Setlength(Desc, Result);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function UTF8Char(S: string; index: Integer; Desc: string): TUTF8Char;
|
function UTF8Char(S: string; index: Integer; Desc: string): TUTF8Char;
|
||||||
|
Loading…
Reference in New Issue
Block a user