lazreport: fixed UTF8Desc to always return a valid UTF8 string

git-svn-id: trunk@47750 -
This commit is contained in:
mattias 2015-02-13 20:40:29 +00:00
parent 69edc4d8c0
commit d85758cb35

View File

@ -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;