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

Converted ui file throws UnicodeEncodeError: 'utf-8' codec can't encode characters in position 1047-1048: surrogates not allowed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 6.6.2
    • Build tools: uic
    • None
    • Win11, Python 3.9
    • Windows

    Description

      After converting the ConfigWindow.ui to Ui_ConfigWindow.py using

      uic.exe ConfigWindow.ui --generator python -o Ui_ConfigWindow.py 

      , and then run ConfigWindow-test.py with it, the program Terminated with the  following error. Test files are attached.

      Tested with PyQt6, I got the following error. The program works well with PyQt5. They said it might be a bug with the Qt6 uic.

      {{Traceback (most recent call last):
        File "F:\BaiduNetdiskDownload\SoftwareProject\LYYDownloader-dev\ConfigWindow.py", line 64, in <module>
          ui = ConfigWindow()
        File "F:\BaiduNetdiskDownload\SoftwareProject\LYYDownloader-dev\ConfigWindow.py", line 27, in __init__
          self.setupUi(self)
        File "F:\BaiduNetdiskDownload\SoftwareProject\LYYDownloader-dev\Ui_ConfigWindow.py", line 179, in setupUi
          self.retranslateUi(Dialog)
        File "F:\BaiduNetdiskDownload\SoftwareProject\LYYDownloader-dev\Ui_ConfigWindow.py", line 211, in retranslateUi
          self.label.setText(QCoreApplication.translate("Dialog", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
      UnicodeEncodeError: 'utf-8' codec can't encode characters in position 1047-1048: surrogates not allowed}}
      .

      Attachments

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

        Activity

          People

            jkobus Jarek Kobus
            philip Philip Lee
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes