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

Qt's QTemporaryDir isn't unicode safe on Windows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.6.2
    • 5.4.1
    • Core: I/O
    • None
    • c14c149b51a1c7bf01e4e039f6e8cf1819e37ca6 (qtbase/5.6, 20.7.2016, 5.6.2)

    Description

      Similar to https://bugreports.qt.io/browse/QTBUG-4796, I noticed that QTemporaryDir doesn't work if the templateName contains unicode characters that are not in the locale.

      Stepping through the code, it seems like QTemporaryDirPrivate::create attempts to convert the templateName using QFile::encodeName.

      This is a problem since we create temporary directory in the user local app data directory on Windows. If the account has foreign characters and the locale is set to standard US English, QTemporaryDir will fail. Note standard QDir mkpath etc, actually works fine so not entirely sure why the QTemporaryDir does what it does in that manner.

      Attachments

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

        Activity

          People

            kleint Friedemann Kleint
            thuan_firelight Thuan Seah
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes