Details
-
Bug
-
Resolution: Incomplete
-
P2: Important
-
None
-
5.12.5
-
None
-
CentOS 8.2
Description
I'm attempting to migrate an old database access configuration from Qt4 (on SUSE Linux Enterprise 11) to Qt5 (on CentOS/RHEL 8) which uses QODBC database driver to interact with a remote database.
I'm seeing strange behaviors related to character encodings within Qt's interactions with the unixODBC API, and really struggling to figure out how to troubleshoot this. CLI tools isql and Python-3 pyodbc library work fine with this configuration but Qt5 has problems.
If I just use the stock library configs with inherited odbc.ini I get Qt connection errors similar to QSqlError (number, driverText, databaseText) tuple: (-1, "QODBC3: Unable to connect", "").
If I add the option "ODBC_App_Unicode_Type=1" at the top of odbcinst.ini and now see text from the database but now the DSN cannot be found: (0, "QODBC3: Unable to connect", "[unixODBC][Driver Manager]Data source name not found and no default driver specified")
I see in a debugger that "sizeof(SQLTCHAR)" is 2, so I expect that all Qt's interaction uses UCS-2. It still seems like there is some disconnect between the encoding that Qt is using and what unixODBC expects.