Update of /cvsroot/q-lang/q/modules/odbc
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv11301
Modified Files:
odbc.c
Log Message:
convert string parameter to system encoding before initializing parameter description
Index: odbc.c
===================================================================
RCS file: /cvsroot/q-lang/q/modules/odbc/odbc.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** odbc.c 2 Feb 2006 00:08:24 -0000 1.5
--- odbc.c 11 Feb 2008 22:58:47 -0000 1.6
***************
*** 212,215 ****
--- 212,217 ----
return 1;
} else if (isstr(x, &s)) {
+ s = utf8_to_sys(s);
+ if (!s) return 0;
db->argv[i].type = SQL_CHAR;
db->argv[i].ctype = SQL_C_CHAR;
***************
*** 217,223 ****
db->argv[i].buflen = strlen(s)+1;
db->argv[i].prec = db->argv[i].buflen-1;
! db->argv[i].data.buf = utf8_to_sys(s);
! db->argv[i].ptr = db->argv[i].data.buf;
! return db->argv[i].data.buf != NULL;
} else if (isobj(x, type(ByteStr), (void**)&m)) {
db->argv[i].type = SQL_BINARY;
--- 219,225 ----
db->argv[i].buflen = strlen(s)+1;
db->argv[i].prec = db->argv[i].buflen-1;
! db->argv[i].data.buf = s;
! db->argv[i].ptr = s;
! return 1;
} else if (isobj(x, type(ByteStr), (void**)&m)) {
db->argv[i].type = SQL_BINARY;
|