Subject Unicode + MFC + gds32.dll
Author manuel_hauck
Hallo,

i'am just a starter with the firebird sql server. I must write a
commerial application useing the firebird sql server. This
application will be shipped around the world, and will be in any
language there is. So i think i will use UNICODE in my application.
But how do i get to store the data in Unicode into the database? I
create a database with the UNICODE_FSS flag, so far. But how do i
handle the SQL string. For example, the "isc_dsql_prepare" funktion
in the gds32.dll whants a char* as Statment. But if i have a Unicode
applicaten i may have that SQL statment:

std::wstring strSql("SELECT * FROM TABLE WHERE NAME = 'SMITH';");
Or
CString strSql = "SELECT * FROM TABLE WHERE NAME = 'SMITH';";

That string is a Unicode string, how can i pass the string to
the "isc_dsql_prepare" function in the gds32.dll? This function
accepts only char* as statment. Do i only have to cast the wchar_t
into a char* ? That doesen't doesent look right!

2. Question
If i use the XSQLVAR structur to pass data into the database, how
should that be done with UNICODE strings. Right now i memcpy the
unicode strings into the XSQLVAR* var-sqldata is that right??????
If yes how does the above selectstament will use the 'SMITH' as
UNICODE again.

What i did so far:
Some colums in the database are createt with CHARACTER SET
UNICODE_FSS.
When i atache the database i set isc_dpb_lc_ctype to "UNICODE_FSS".
I tried the _UNICODE_FSS but that seams not to work for me.

The unicode thing is not that clear to me, an i couldend find
anything in the docus or in the internet. I think i need help from a
expert on the unicode thing.


Manuel Hauck