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

QApplication.arguments() mangles character encoding

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P4: Low
    • 6.1
    • 5.15.1
    • PySide
    • None
    • All
    • 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

        For Gerrit Dashboard: PYSIDE-1425
        # Subject Branch Project Status CR V

        Activity

          People

            kleint Friedemann Kleint
            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