views:

22

answers:

1

Is there a way to display other language characters in PyQt4? and if there is, what's the approach/direction that I should take? Thanks in advance.

+2  A: 

Qt uses Unicode and should be able to display (Unicode) text in any language you have a suitable font for. For example, Roberto Alesina's simple "Hello World" program on the PyQt Wiki -- which I transcribe for readability (and w/o the comments for brevity) since it's pretty unreadable in the wiki -- should let you use as the button's text any such Unicode text (so I've taken the liberty of translating it so it uses an accented letter;-)...:

# -*- coding: utf-8 -*-
# (or w/ever other coding you use for unicode literals;-)
import qt, sys
a=qt.QApplication(sys.argv)
w=qt.QPushButton(u"Olá Mundo", None)
w.show()
a.exec_loop()
Alex Martelli