Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1425

QApplication.arguments() mangles character encoding

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4: Low
    • Resolution: Done
    • Affects Version/s: 5.15.1
    • Fix Version/s: 6.1
    • Component/s: PySide
    • Labels:
      None
    • Platform/s:
      All
    • Commits:
      7809a047416eacb6f245160aa018127f5b0e8e81 (pyside/pyside-setup/dev)

      Description

      QApplication.arguments() assumes that the arguments are encoded in the system locale and converts them to UTF-8. However, all Python 3 strings are already UTF-8 encoded, which leads to Qt mangling arguments if the argument has characters that are encoded differently in the system locale than in UTF-8.

      E.g. on systems using ISO-8859-1 we get the same as if we did:
      "รค".encode("UTF-8").decode("ISO-8859-1")

      Setting QTextCodec.codecForLocale to UTF-8 is a workaround but given that all strings in Python 3 are UTF-8, that should probably not be necessary.

        Attachments

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

          Activity

            People

            Assignee:
            kleint Friedemann Kleint
            Reporter:
            tim_hallmann Tim Hallmann
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes