Discussion:
[Firebird-odbc-devel] BLOB Text data codepage conversion for SQL_C_WCHAR
Jojakim
2013-02-07 11:14:10 UTC
Permalink
Dear specialists,
I need your advice for the following problem:

(see also http://tracker.firebirdsql.org/browse/ODBC-161)

I bound a BLOB SUB_TYPE 1 CHARACHTER SET UTF8 field to SQL_C_WCHAR /
SQL_LONGVARCHAR via SQLBindParameter on an insert operation. Then encountered
problems when using SQLPutData to put in my chardata. Connection charset is
UTF8.

1. I found, that in the IPD the concise type is set to SQL_C_BINARY. Is this
also a good/valid choice for BLOB SUB_TYPE 1, or for this BLOB type wouldn't
it be better to set it to SQL_C_CHAR?

2. The wcstombs and vice versa codepage translation function is setup with a
call to getAdressWcsToMbs / getAdressMbsToWcs which in turn passes
qlda->getSubType( index ) to adressWcsToMbs/adressMbsToWcs. For normal CHAR
or VARCHAR database fields, the subtype contains 3=UNICODE_FSS or 4=UTF8 or
in general I assume the fb charset id. But in the case of BLOB, subtype is
not used to indicate the specified BLOB SUB_TYPE (again, I can't prove but I
assume based on the values found while debugging). So my question is, how, in
case of a BLOB, I can find the fb charset id to use, and then make a link to
the correct codepage conversion function?

All thanks for your help !

--
Joja
Jojakim
2013-02-07 12:08:15 UTC
Permalink
...But in the case of BLOB,
subtype is not used to indicate the specified BLOB SUB_TYPE ...
Sorry, there is a typo: Must be:

But in the case of BLOB, subtype _is_ used to indicate the specified BLOB
SUB_TYPE

Loading...