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;
function UTF8Desc(S: string; var Desc: string): Integer;
var
i,b: Integer;
begin
i := 1;
Result := 0;
SetLength(Desc, Length(S));
while i<=Length(s) do begin
b := UTF8CharacterStrictLength(@S[i]);
inc(i,b);
inc(Result);
Desc[Result] := Char(b);
end;
Setlength(Desc, Result);
Desc:=S;
UTF8FixBroken(Desc);
Result:=length(Desc);
end;
function UTF8Char(S: string; index: Integer; Desc: string): TUTF8Char;