I am trying to set the label of a GUI-element to display a greek letter with Python.
str(u'u0054'.encode('utf8'))
will correctly produce the unicode character 'T', as its unicode number is 0054.
Writing
str(u'u03B6'.encode('utf8'))
will not display the Greek letter small zeta but this thing instead.
I tried writing
str(u'uceb6'.encode('utf8'))
as well (ceb6 is the utf-8 encoding of the character I want), but got a similar, strange looking character that certainly wasn't the Greek letter zeta.
According to this site the character is available in common fonts.
Might it be that the GUI-toolkit uses a strange font? I am using the FOX toolkit.
Any help is appreciated.
EDIT:
I am specifically trying to create a text label FXLabel(parent, string)
where i supply the string str(u'u03B6'.encode('utf8'))
. And as mentioned, supplying the string with the unicode number of capital t will produce the expected label.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…