[PyQt] string encoding problem with pylupdate4

Phil Thompson phil at riverbankcomputing.com
Mon May 4 15:27:28 BST 2009


On Sat, 02 May 2009 04:26:38 +0200, Tóth Csaba <csaba.toth at davidnet.hu>
wrote:
> hi,
> 
> i have a problem with the pylupdate4.exe and the encoding it realises.
> 
> If i have this code in a py file:
> 
> #!/usr/bin/env python
> # -*- coding: utf-8 -*-
> #
> 
> a = QtCore.QT_TR_NOOP('Listás hívás összesítő')
> b = self.trUtf8('Listás hívás összesítő')
> 
> 
> than i run `pylupdate4.exe file.py -ts tr.ts`
> 
> than if i open the translate.ts with Linguist i see these two strings to
> translate (i understand the different context of these strings, the
> question is with the encodings of them, why differ?)
> 
> Listás hívás összesítő
> Listás hívás összesítő
> 
> 
> attached you can find a .ts file i generated. I use
> PyQt-Py2.6-gpl-4.4.4-2 with Python 2.6.2.
> 
> How can i solve this?

pylupdate4 ignores the coding: utf-8 and so doesn't know that the string
passed to QT_TR_NOOP() is utf8.

I've added support for QT_TR_NOOP_UTF8() which you should use instead.

Phil


More information about the PyQt mailing list