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

Andreas Pakulat apaku at gmx.de
Thu Jan 26 01:11:08 GMT 2006


On 26.01.06 02:53:31, Ismail Donmez wrote:
> I am using QDate.toString(QtCore.Qt.TextDate) in my application and Turkish 
> characters are malformed unless I do 
> unicode(QDate.toString(QtCore.Qt.TextDate) , I checked the Qt4 apidocs and it 
> says :
> 
> QString toString ( const QString & format ) const 
> QString toString ( Qt::DateFormat format = Qt::TextDate ) const
> 
> so it should already be supporting UTF-8, is there a problem with PyQt4 or am 
> I missing something here?

How do you use the resulting QString? Small Test in a python interpreter
shows that a Qstring with non-ascii characters is always converted via
unicode() to a python unicode string when that is needed. Also note that
QString has a toUtf8() method.

andreas

-- 
Your own qualities will help prevent your advancement in the world.




More information about the PyQt mailing list