Hi, all<br><br>In PyQt Designer 4.5.2 I set the property &#39;text&#39; of a
QPushButton to some Chinese characters, and when I run pyuic4 to
generate the coresponding .py file, it reports error, here is traceback:<br><br>
  File &quot;E:\Python26\lib\site-<div id=":tx" class="ii gt">packages\PyQt4\uic\port_v2\invoke.py&quot;, line 12, in invoke<br>    exit_status = driver.invoke()<br>  File &quot;E:\Python26\lib\site-packages\PyQt4\uic\driver.py&quot;, line 37, in invoke<br>

    self._generate()<br>  File &quot;E:\Python26\lib\site-packages\PyQt4\uic\driver.py&quot;, line 63, in _generate<br>    self._opts.pyqt3_wrapper)<br>  File &quot;E:\Python26\lib\site-packages\PyQt4\uic\__init__.py&quot;, line 65, in compileUi<br>

    winfo = compiler.UICompiler().compileUi(uifile, pyfile)<br>  File &quot;E:\Python26\lib\site-packages\PyQt4\uic\Compiler\compiler.py&quot;, line 66, in compileUi<br>    w = self.parse(input_stream)<br>  File &quot;E:\Python26\lib\site-packages\PyQt4\uic\uiparser.py&quot;, line 768, in parse<br>

    actor(elem)<br>  File &quot;E:\Python26\lib\site-packages\PyQt4\uic\uiparser.py&quot;, line 616, in createUserInterface<br>    self.traverseWidgetTree(elem)<br>  File &quot;E:\Python26\lib\site-packages\PyQt4\uic\uiparser.py&quot;, line 594, in traverseWidgetTree<br>

    handler(self, child)<br>  File &quot;E:\Python26\lib\site-packages\PyQt4\uic\uiparser.py&quot;, line 168, in createWidget<br>    self.traverseWidgetTree(elem)<br>  File &quot;E:\Python26\lib\site-packages\PyQt4\uic\uiparser.py&quot;, line 594, in traverseWidgetTree<br>

    handler(self, child)<br>  File &quot;E:\Python26\lib\site-packages\PyQt4\uic\uiparser.py&quot;, line 168, in createWidget<br>    self.traverseWidgetTree(elem)<br>  File &quot;E:\Python26\lib\site-packages\PyQt4\uic\uiparser.py&quot;, line 594, in traverseWidgetTree<br>

    handler(self, child)<br>  File &quot;E:\Python26\lib\site-packages\PyQt4\uic\uiparser.py&quot;, line 162, in createWidget<br>    self.stack.push(self.setupObject(widgetClass(elem), parent, elem))<br>  File &quot;E:\Python26\lib\site-packages\PyQt4\uic\uiparser.py&quot;, line 135, in setupObject<br>

    self.wprops.setProperties(obj, branch)<br>  File &quot;E:\Python26\lib\site-packages\PyQt4\uic\properties.py&quot;, line 271, in setProperties<br>    getattr(widget, &quot;set%s%s&quot; % (ascii_upper(propname[0]), propname[1:]))(self.convert(prop, widget))<br>

  File &quot;E:\Python26\lib\site-packages\PyQt4\uic\properties.py&quot;, line 231, in convert<br>    return func(prop[0], **args)<br>  File &quot;E:\Python26\lib\site-packages\PyQt4\uic\properties.py&quot;, line 214, in _font<br>

    getattr(newfont, &quot;set%s&quot; % (attr,))(converter(v))<br>UnicodeEncodeError: &#39;ascii&#39; codec can&#39;t encode characters in position 0-3: ordinal not in range(128)<br><br>It seems pyuic4 cannot handle Chinese characters correctly. Is there anyway to deal with unicode? Many thanks.</div>