* Call Translate for blobfields as well (bug ID 25083)

git-svn-id: trunk@30640 -
This commit is contained in:
michael 2015-04-18 06:36:00 +00:00
parent 62e50ca506
commit 1211149a29

View File

@ -2815,17 +2815,28 @@ function TBlobField.GetAsString: string;
var var
Stream : TStream; Stream : TStream;
Len : Integer; Len : Integer;
R : String;
begin begin
Stream := GetBlobStream(bmRead); Stream := GetBlobStream(bmRead);
if Stream <> nil then if Stream <> nil then
with Stream do with Stream do
try try
Len := Size; Len := Size;
SetLength(Result, Len); SetLength(R, Len);
if Len > 0 then if Len > 0 then
ReadBuffer(Result[1], Len); begin
ReadBuffer(R[1], Len);
if not Transliterate then
Result:=R
else
begin
SetLength(Result,Len);
DataSet.Translate(@R[1],@Result[1],False);
end;
end;
finally finally
Free Free;
end end
else else
Result := ''; Result := '';
@ -2920,12 +2931,23 @@ end;
procedure TBlobField.SetAsString(const AValue: string); procedure TBlobField.SetAsString(const AValue: string);
var var
Len : Integer; Len : Integer;
R : String;
begin begin
with GetBlobStream(bmWrite) do with GetBlobStream(bmWrite) do
try try
Len := Length(AValue); Len := Length(AValue);
if Len > 0 then if (Len>0) then
WriteBuffer(AValue[1], Len); begin
if Not Transliterate then
R:=AValue
else
begin
SetLength(R,Len);
Len:=Dataset.Translate(@AValue[1],@R[1],True);
end;
WriteBuffer(R[1], Len);
end;
finally finally
Free; Free;
end; end;