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

Character encoding issue with unixODBC on CentOS 8

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P2: Important
    • None
    • 5.12.5
    • SQL Support
    • None
    • CentOS 8.2
    • Linux/Wayland, Linux/X11

    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

        1. pyodbc-works.trace.txt
          9 kB
          Brian Sipos
        2. qodbc-fails.trace.txt
          4 kB
          Brian Sipos
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            mabrand Mark Brand
            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