Hello everyone,

I was just writing some code today and after a while I came across some code 
that used unicode strings, normally not a problem but I noticed that tr and 
trUtf8 both don't accept unicode strings. Would it be possible to add this 
since it would be logical to convert a python unicode string to a QT escaped 
unicode string.

Example code:
from PyQt4 import QtCore
object = QtCore.QObject()

normal_string = str('test')
unicode_string = unicode('test')

''' this works '''
object.tr(normal_string)
object.trUtf8(normal_string)

''' this doesn't '''
object.tr(unicode_string)
object.trUtf8(unicode_string)

Naturally, the bottom two give a TypeError but I would expect it to do a cast 
to str() for tr or just accept the string for trUtf8.

-- 
Rick van Hattem Rick.van.Hattem(at)Fawo.nl

Attachment: pgprRVgoL5X2t.pgp
Description: PGP signature

_______________________________________________
PyKDE mailing list    [email protected]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

Reply via email to