[erlang-bugs] ODBC R12B-5 Win32: Select statement doesn't work

Денис Артёмов <>
Wed Dec 3 06:13:23 CET 2008


Another results of my investigations: it looks like author of ODBC Erlang library didn't provide the support of Unicode at all.

I could to avoid "not supported type" error messages by adding

    case SQL_WCHAR:
    case SQL_WVARCHAR:
    case SQL_WLONGVARCHAR:

into map_sql_2_c_column function of odbcserver.c file like this:

static db_result_msg map_sql_2_c_column(db_column* column)
{
    db_result_msg msg;

    msg = encode_empty_message();
        
    switch(column -> type.sql) {
    case SQL_CHAR:
    case SQL_VARCHAR:

    case SQL_BINARY:
    case SQL_LONGVARCHAR:
    case SQL_VARBINARY:
    case SQL_LONGVARBINARY:

    case SQL_WCHAR:         //
    case SQL_WVARCHAR:      // I've added this lines
    case SQL_WLONGVARCHAR:  //

    column -> type.len = (column -> type.col_size) +

    ...

... and by recompiling odbcserver.exe with changed sources.

Error messages don't occur this way, but the data is retrieved in raw format depending of charset of database. For example, word "Денис" is retrieved as {[208,148,208,181,208,189,208,184,209,129]} for UTF-8 charset.

Will ODBC library support unicode correctly?



More information about the erlang-bugs mailing list