[PyQt] PyQt4 - QChar - unicode char?

David Cortesi davecortesi at gmail.com
Sat Oct 5 21:10:42 BST 2013


# python 2.7
from future import unicode_literals
uu = u'\u2019' # no problem here but...
qcCurlyApostrophe = QChar(uu)
Traceback (most recent call last):
    File "<string>", line 1, in <fragment>
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in
position 0: ordinal not in range(128)
qcCurlyApostrophe = QChar(8217) # int workaround ok

So - user error? Or failure to recognize the "QChar::QChar(uchar ch)"
overload signature?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20131005/9b177a82/attachment.html>


More information about the PyQt mailing list