BlobStream and codepage problem

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
piper62
Junior Boarder
Junior Boarder
Posts: 25
Joined: 25.06.2007, 10:40

BlobStream and codepage problem

Post by piper62 »

Hello,

I have a problem with a BlobSteream.
Environment is: Debian Linux (Etch), FPC 2.0.4, Lazarus 0.9.20 and ZeosLib 6.6.1 (stable).

The purpose is to store files in a blob field a table. The code below worked perfectly with any type of files. Also the size of the files was no problem. -If we pay attention to the MySQL settings.

We changed the ZConnection properties to "codepage=utf8" to solve our codepage problems.
But now I have the problem that the writing of the blobs to the database generates buggy files.
The read out is no problem. There the codepage doesn't effect the files.
Also the filesize is different, I get smaller files if I switch "codepage=utf8" on.
Is the FileStream.Size the problem?

Help appreciated!
Regards,
Tibor

--------------------------------------------------------------------------------
ZQuery1.Append;
BlobStream := ZQuery1.CreateBlobStream(ZQuery1.FieldByName('image'), bmWrite);
try
FileStream := TFileStream.Create(Opendialog1.FileName, fmOpenRead);
try
BlobStream.CopyFrom(FileStream, FileStream.Size);
finally
FileStream.Free;
end;
finally
BlobStream.Free;
end;
--------------------------------------------------------------------------------
piper62
Junior Boarder
Junior Boarder
Posts: 25
Joined: 25.06.2007, 10:40

Post by piper62 »

update:
-FileStream.Size is not the problem. same size independent from codepage setting.

at the moment I make a workaround by clearing the properties on the ZConnection, then writing the blob field and resetting it after the commit.

I don't like this solution but at the moment it works.

has anybody an explanation why it doesn't work with utf8 ?

Regards,
Tibor
Post Reply