<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="ProgId" content="Word.Document"><meta name="Generator" content="Microsoft Word 11"><meta name="Originator" content="Microsoft Word 11"><link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CWinPc%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"><style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
text-align:right;
mso-pagination:widow-orphan;
direction:rtl;
unicode-bidi:embed;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
p
{mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
span.shorttext
{mso-style-name:short_text;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style>
<p class="MsoNormal" style="text-align: left; direction: ltr; unicode-bidi: embed;">Hi
, <span dir="RTL" lang="FA"></span></p>
<p class="MsoNormal" style="text-align: left; direction: ltr; unicode-bidi: embed;"><span dir="RTL" lang="FA"> </span></p>
<p class="MsoNormal" style="text-align: left; direction: ltr; unicode-bidi: embed;">In
some windows systems that the default python encoding is not set to utf-8 , <br></p><p class="MsoNormal" style="text-align: left; direction: ltr; unicode-bidi: embed;"><br></p><p class="MsoNormal" style="text-align: left; direction: ltr; unicode-bidi: embed;">
for
example is ascii , and use<span style=""> </span>PyQt Designer
4.7.4<span style=""> </span>with<span style=""> </span>Python 3.1.1 ,</p>
<p class="MsoNormal" style="text-align: left; direction: ltr; unicode-bidi: embed;"> </p>
<p class="MsoNormal" style="text-align: left; direction: ltr; unicode-bidi: embed;">when
<span style=""> </span>you <span class="shorttext"><span style="color: black; background: none repeat scroll 0% 0% white;">design</span></span> an UI that content
Unicode data with <span class="shorttext"><span style="color: black; background: none repeat scroll 0% 0% white;">Designer</span></span> , and save it in a file such as example.ui ,</p>
<p class="MsoNormal" style="text-align: left; direction: ltr; unicode-bidi: embed;"> </p>
<p class="MsoNormal" style="text-align: left; direction: ltr; unicode-bidi: embed;">then
<span class="shorttext">when you try to convert it by "pyuic4" to a
python file <span style=""> </span>such as ui_example.py ,</span></p>
<p class="MsoNormal" style="text-align: left; direction: ltr; unicode-bidi: embed;"><span class="shorttext"> </span></p>
<p class="MsoNormal" style="text-align: left; direction: ltr; unicode-bidi: embed;"><span class="shorttext">Since Python Standard Input is not set to unicode , so<span style=""> </span>pyuic4(pyuic.py) Faced with the problem :</span></p>
<p><span style="color: maroon;">#pyuic4 -o <span class="shorttext">ui_example.py </span><span style=""> </span>example.ui<br>
An unexpected error occurred.<br>
Check that you are using the latest version of PyQt and send an error report to<br>
<email address hidden>, including the following information:</span></p>
<p><span style="color: maroon;"> * your version of PyQt (4.7.2)<br>
* the UI file that caused this error<br>
* the debug output of pyuic4 (use the -d flag when calling pyuic4)</span></p>
<p class="MsoNormal" style="text-align: left; direction: ltr; unicode-bidi: embed;"> </p>
<p class="MsoNormal" style="text-align: left; direction: ltr; unicode-bidi: embed;"><span class="shorttext">Precisely the error is related to the this file :</span></p>
<p class="MsoNormal" style="text-align: left; direction: ltr; unicode-bidi: embed;"> </p>
<p class="MsoNormal" style="text-align: left; direction: ltr; unicode-bidi: embed;"><span style="color: maroon;">/Python.3.1.1/Lib/site-packages/PyQt4/uic/driver.py</span></p>
<p class="MsoNormal" style="text-align: left; direction: ltr; unicode-bidi: embed;"> </p>
<p class="MsoNormal" style="text-align: left; direction: ltr; unicode-bidi: embed;">and
in this line (59) :</p>
<p class="MsoNormal" style="text-align: left; direction: ltr; unicode-bidi: embed;"> </p>
<p class="MsoNormal" style="text-align: left; direction: ltr; unicode-bidi: embed;"><span style="color: maroon;">pyfile = open(self._opts.output, 'wt')</span></p>
<p class="MsoNormal" style="text-align: left; direction: ltr; unicode-bidi: embed;"><span style="color: maroon;"> </span></p>
<p class="MsoNormal" style="text-align: left; direction: ltr; unicode-bidi: embed;"><span class="shorttext">So I modified it <span style=""> </span>to it :</span></p>
<p class="MsoNormal" style="text-align: left; direction: ltr; unicode-bidi: embed;"> </p>
<p class="MsoNormal" style="text-align: left; direction: ltr; unicode-bidi: embed;"><span style="color: maroon;">pyfile = open(self._opts.output, 'wt',encoding='utf-8')</span></p>
<p class="MsoNormal" style="text-align: left; direction: ltr; unicode-bidi: embed;"><span style="color: maroon;"> </span></p>
<p class="MsoNormal" style="text-align: left; direction: ltr; unicode-bidi: embed;"><span style="color: maroon;"> </span></p>
<p class="MsoNormal" style="text-align: left; direction: ltr; unicode-bidi: embed;"><span class="shorttext"><span style="background: none repeat scroll 0% 0% white;">And the problem was resolved</span></span>
, t<span class="shorttext">emporarily .</span></p>
<br><br clear="all"><span style="color: rgb(192, 192, 192);">--</span><br style="color: rgb(192, 192, 192);"><span style="color: rgb(192, 192, 192);">Omid <span style="color: rgb(102, 102, 102);">Raha</span></span><br><br>
<br><br>