RCS file: /usr/local/cvsroot/psqlodbc/psqlodbc/convert.c,v retrieving revision 1.102 diff -r1.102 convert.c 2561,2565d2560 < /********************* < * it's not correct to convert depending on param_sqltype, < * because the client_encoding is always unicode. < * We need conversion in any case. < */ 2569,2594c2564,2571 < switch (param_sqltype) < { < case SQL_WCHAR: < case SQL_WVARCHAR: < case SQL_WLONGVARCHAR: < if (SQL_NTS == used) < used = strlen(buffer); < allocbuf = malloc(2 * (used + 1)); < used = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, buffer, < used, (LPWSTR) allocbuf, used + 1); < buf = ucs2_to_utf8((SQLWCHAR *) allocbuf, used, &used); < free(allocbuf); < allocbuf = buf; < break; < default: < < if (SQL_NTS == used) < used = strlen(buffer); < allocbuf = malloc(2 * (used + 1)); < used = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, buffer, < used, (LPWSTR) allocbuf, used + 1); < buf = ucs2_to_utf8((SQLWCHAR *) allocbuf, used, &used); < free(allocbuf); < allocbuf = buf; < buf = buffer; < } --- > if (SQL_NTS == used) > used = strlen(buffer); > allocbuf = malloc(2 * (used + 1)); > used = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, buffer, > used, (LPWSTR) allocbuf, used + 1); > buf = ucs2_to_utf8((SQLWCHAR *) allocbuf, used, &used); > free(allocbuf); > allocbuf = buf;