Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-91503

Character encoding issue with unixODBC on CentOS 8

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Incomplete
    • Affects Version/s: 5.12.5
    • Fix Version/s: None
    • Component/s: SQL Support
    • Labels:
      None
    • Environment:
      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.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            mabrand Mark Brand
            Reporter:
            bsipos-rkf Brian Sipos
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes