[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re:Re: Converted ui file throws UnicodeEncodeError: 'utf-8' codec can't encode characters in positio
From:       lizhao0512 () 126 ! com
Date:       2024-03-04 13:18:44
Message-ID: e69b4e6.12627.18e099dddd0.Coremail.lizhao0512 () 126 ! com
[Download RAW message or body]

[Attachment #2 (text/plain)]

But the code works well for PyQT5, no such exceptions with PyQt5




--

Sincerely,
Zhao Li





At 2024-03-04 17:15:24, "Phil Thompson" <phil@riverbankcomputing.com> wrote:
>On 04/03/2024 02:30, lizhao0512@126.com wrote:
>> After converting the ConfigWindow.ui to Ui_ConfigWindow.py, and then
>> run ConfigWindow-test.py with it, I got the following error. Test
>> files are attached.
>> 
>> 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
>
>Assuming the text really is utf-8 then I think that is a Python 
>limitation.
>
>Phil

[Attachment #3 (text/html)]

<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div \
style="margin: 0;">But the code works well for PyQT5, no such exceptions \
with PyQt5</div><p style="margin: 0;"><br></p><div \
style="position:relative;zoom:1"><p style="margin: 0">--</p><div \
style="margin:0;">Sincerely,</div><div style="margin:0;">Zhao Li</div><div \
style="clear:both"></div></div><div id="divNeteaseMailCard"></div><p \
style="margin: 0;"><br></p><pre><br>At 2024-03-04 17:15:24, "Phil Thompson" \
&lt;phil@riverbankcomputing.com&gt; wrote: &gt;On 04/03/2024 02:30, \
lizhao0512@126.com wrote: &gt;&gt; After converting the ConfigWindow.ui to \
Ui_ConfigWindow.py, and then &gt;&gt; run ConfigWindow-test.py with it, I \
got the following error. Test &gt;&gt; files are attached.
&gt;&gt; 
&gt;&gt; Traceback (most recent call last):
&gt;&gt;   File
&gt;&gt; "F:\BaiduNetdiskDownload\SoftwareProject\LYYDownloader-dev\ConfigWindow.py",
 &gt;&gt; line 64, in &lt;module&gt;
&gt;&gt;     ui = ConfigWindow()
&gt;&gt;   File
&gt;&gt; "F:\BaiduNetdiskDownload\SoftwareProject\LYYDownloader-dev\ConfigWindow.py",
 &gt;&gt; line 27, in __init__
&gt;&gt;     self.setupUi(self)
&gt;&gt;   File
&gt;&gt; "F:\BaiduNetdiskDownload\SoftwareProject\LYYDownloader-dev\Ui_ConfigWindow.py",
 &gt;&gt; line 179, in setupUi
&gt;&gt;     self.retranslateUi(Dialog)
&gt;&gt;   File
&gt;&gt; "F:\BaiduNetdiskDownload\SoftwareProject\LYYDownloader-dev\Ui_ConfigWindow.py",
 &gt;&gt; line 211, in retranslateUi
&gt;&gt;     self.label.setText(QCoreApplication.translate("Dialog", \
"&lt;!DOCTYPE &gt;&gt; HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\"
&gt;&gt; \"http://www.w3.org/TR/REC-html40/strict.dtd\"&gt;\n"
&gt;&gt; UnicodeEncodeError: 'utf-8' codec can't encode characters in \
position &gt;&gt; 1047-1048: surrogates not allowed
&gt;
&gt;Assuming the text really is utf-8 then I think that is a Python 
&gt;limitation.
&gt;
&gt;Phil
</pre></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic