[PyKDE] [PyQt4] QDate.toString(QtCore.Qt.TextDate) is not UTF-8

Phil Thompson phil at riverbankcomputing.co.uk
Thu Jan 26 14:27:27 GMT 2006


On Thursday 26 January 2006 1:44 pm, Ismail Donmez wrote:
> Per 26 Oca 2006 15:35 tarihinde, Phil Thompson şunları yazmıştı:
> > On Thursday 26 January 2006 1:10 pm, Ismail Donmez wrote:
> > > Per 26 Oca 2006 11:29 tarihinde, Andreas Pakulat şunları yazmıştı:
> > > > On 26.01.06 03:15:54, Ismail Donmez wrote:
> > > > > I am doing something like this QStatusBar.showMessage("Foo - %s" %
> > > > > QDate.toString(QtCore.Qt.TextDate))
> > > >
> > > > Does it work with:
> > > >
> > > > QStatusBar.showMessage(QtCore.QString("Foo -
> > > > %1").arg(QDate.toString(QtCore.Qt.QTextDate)))
> > >
> > > This one works fine too, guess there is a problem with %s, Phil can you
> > > comment on this?
> >
> > You are converting Unicode to a string then back to Unicode. PyQt tries
> > (not very hard) to find a Python codec matching the current Qt codec and
> > falls back to the default Python codec. This is obviously going wrong at
> > some point, but I'm not surprised.
> >
> > Did you do something similar with PyQt3? Did you try with both 3.15.1 and
> > the current PyQt3 snapshot?
>
> Its the same with current PyQt3 snapshot. So I guess it was all like this
> before too. Thanks you both.

I'd still like to know if it works with PyQt 3.15.1 - there have been changes 
that would affect this since then.

Phil




More information about the PyQt mailing list