You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.
Hello,
I have any issue probably linked to utf-8. Also I am pretty sure this is not specific to Taurus, but I probably am tired since I do not find whate is the cause
When I try to print a string with a special character like "°C", it is printed with a first special character before the string "°C".
My file type is "utf-8" :
file accents.py
accents.py: Python script, UTF-8 Unicode text executable
To give a complete example, here is a test program :
As you suspected, it is not a Taurus issue but a PyQt4+python2 issue.
In python2 str and utf are different and therefore you should explicitly declare your string as utf:
#!/usr/bin/python# -*- coding: utf8 -*-importsysfromPyQt4importQtGuiapp=QtGui.QApplication([])
t=u'°C'# <-- NOTE THE EXPLICIT UTF declaration using the `u` prefix!w=QtGui.QLabel()
w.setText(t)
w.show()
sys.exit(app.exec_())
Other comments:
In your example, do not use the str.decode('utf-8') call (not needed)
In your example you are using TaurusLabels for static text (not associated with a model). I suggest that you use pure QLabels for that instead
Also note that in your code you are essentially imitating the work of a TaurusForm. Consider using it. (it will automatically use the unit defined for the attribute)
Regarding the support for the "degree" symbol in taurus (pint) units, see this
Hello,
I have any issue probably linked to utf-8. Also I am pretty sure this is not specific to Taurus, but I probably am tired since I do not find whate is the cause
When I try to print a string with a special character like "°C", it is printed with a first special character before the string "°C".
My file type is "utf-8" :
To give a complete example, here is a test program :
And a
The text was updated successfully, but these errors were encountered: