Problems arise after I insert the binary data into the MySQL database
using the query construct (ie: query << "INSERT INTO files (content)
VALUES (\"" << escape << compressed_data << "\")"; where compressed_data
is the resulting buffer from a zlib compress() operation.
Hi,
The place to start is to take a close look at the output of
escape << compressed_data
Or you can sidestep the issue altogether by converting to an ASCII Hex
string instead.
e.g. 0xA041..... etc...
The disadvantage of the Hex string approach is that it doubles the size of
the data transfer (the storage size is the same). The advantage is that it
has been totally reliable for me and avoids a whole slew of problems when
trying to pass binary data around...
Another thought about your problem is to be very careful of Unicode vs
SBCS..... a mismatch will quickly and invisibly torpedo your program....
Hope this Helps,
Erik Perrohe -- Seattle, USA