PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 681 - Unicode support for trUtf8 method
: Unicode support for trUtf8 method
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: PySide
: HEAD
: All All
: P3 normal
Assigned To: Hugo Parente Lima
:
:
:
  Show dependency treegraph
 
Reported: 2011-02-11 07:44 EET by Daniele Esposti
Modified: 2011-02-17 19:18 EET (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniele Esposti 2011-02-11 07:44:17 EET
All the methods in PySide toolkit which accept a string (i.e.
QtCore.QT_TR_NOOP, QObject.tr() or QtCore.SIGNAL() ) doesn't accept unicode
strings.
Comment 1 Hugo Parente Lima 2011-02-11 16:43:38 EET
This bug is valid for the tr methods, but not for QtCore.SIGNAL, we can't
accept unicode stringss there because Qt metaobject system doesn't supports
signal names written using unicode characters.

Prioritizing as P3.
Comment 2 Hugo Parente Lima 2011-02-16 17:08:28 EET
QObject.tr can't accept unicode because it calls the C++ version of this
function, QObject::tr(const char*) and we can't put an unicode string into a
const char* variable unless we use some encoding.

QObject.QT_TR_NOOP already accept unicode, in fact they accept anything and
just returns what they got as parameter.

What I would do, and in fact I'm doing, is add support for unicode into
QObject::trUtf8 method, so if you call it with an unicode, the unicode string
is encoded into UTF8 and used to do the C++ call.
Comment 3 Hugo Parente Lima 2011-02-16 19:43:41 EET
Fixed in commit:

pyside/4305a54b423d8a0915e6566b83188fd867fe47eb

QObject:trUtf8 now accepts unicode objects, QObject::tr still not as explained
in comment #2.
Comment 4 Hugo Parente Lima 2011-02-17 19:18:25 EET
Released in 1.0.0~rc1