How to display international scripts in QLabels?
问题 I would like to display Indic, Arabic and Hebrew scripts in a QLabel, specifying the font type. When I try to pass a UTF-8 encoded string into a QLabel, the script is not rendered properly. What is the correct way to display international (non-alphabetic) scripts in a QLabel? 回答1: Setting the text of a QLabel to a unicode string ( unicode in python2, str in python3) should work fine. In python2 you can use QString.fromUtf8 to convert a utf8-encoded str to an unicode QString , or .decode('utf