[PyKDE] Python Unicode Objects and Qt Unicode strings

dan dan at eevolved.com
Sat Dec 16 23:10:09 GMT 2000


> Would it be a good idea to have QString
> return UTF8 encoded text when converted with unicode()? Or perhaps,
> but I don't know whether that is possible, make QString work with
> the codec options of unicode().

This doesn't work, but it may be a step in the right direction (I bet you've 
tried this)
QString has a method called utf8()
if I use your code to print out the python unicode string, then print out the 
QString using its method utf8() I get identical output
e.g.
print psu.encode('utf-8')
print qsu.utf8()

same (gross :) output

I'm interested in the solution to this problem (because any second I'll be 
using unicode in my project too)

good luck (and, if possible, keep me informed)
Dan




More information about the PyQt mailing list