Subject character sets and arrays and blobs
Author Geoff Worboys
Hi,

I've been working on some data transfer code (its for an alternative
backup utility in case you are interested). Character sets have
caused me considerable grief. After reviewing the source code for
burp, in particular the restore.e and backup.e files I have come to
the conclusion that...

To transfer normal text fields without problems I have to resort to
BLR so that I can specify the character set id for each field
(blr_text2 etc). The standard API mechanisms assume the connection
character set leading to possible translation problems in various
situations (particularly with character set NONE fields).

That is to say; By using BLR I can force the read/write processing to
use the same character set as the actual field and so avoid IB/FB
"transliteration" processing.

It would save me some time is someone could confirm that I am correct,
that the use of BLR will allow me to avoid problems in this situation.
If not, I guess I will find out the hard way shortly :-)


My main questions relate to arrays and blobs:

Blobs...

I had thought I would have to do something special for blob sub_type
text - since it supports character set declarations. However it seems
that IB/FB does not apply translation unless you explicitly supply
filters (at least I dont get an error when writing a blob from a
character set NONE connection to a blob that is using WIN1250
character set - via the database default character set.)

Is anyone able to tell me whether it always OK to simply read/write
blobs without application of matching character set filters? That is;
if I read a blob without applying filters it will be supplied as raw
data that I can also write without filtering and be sure the data is
unchanged?

And having answered that... What about sub_type 0? IB/FB accepts the
declaration of character set against sub_type 0, even though it is
supposed to be unstructured.


Arrays...

Looking through Restore.e there is reference to blr_text2 and other
character set specific blr data types when writing array data. There
does not seem to be any matching reference in Backup.e. At the moment
I am presuming this must be provided to support differences in
previous releases.

Given that I simply want to read an array from a table (whatever its
character set) and write to another (which has a matching character
set) then do I need to do anything special to manage the possibility
that the connection is using a different character to the array field?
Or is IB/FB ignoring character set issues with Arrays just as it seems
to be with blobs?

I hope that makes sense.


Any help/advice would be appreciated.

TIA

Geoff Worboys
Telesis Computing