[Qt-interest] QString is changing when the first character is any special character.
Stephen Jackson
spjackson42 at gmail.com
Mon Feb 22 12:33:07 CET 2010
On 22 February 2010 10:59, Asheq Hamid <asheq at ankur.org.bd> wrote:
>
> #!/usr/bin/python
> # -*- coding: utf-8 -*-
> import sys
> reload(sys)
> sys.setdefaultencoding('utf-8')
> from PyQt4 import QtCore
> text = QtCore.QString("%(devicename)s está sincronizado actualmente con
> %(synclist)s.")
> print text
>
> The output was:
> %(devicename)s está sincronizado actualmente con %(synclist)s.
>
> So you can see that á is changed to á. As I deleted the first % character,
> I saw á is not changed anymore.
>
Try QtCore.String.fromUtf8(...)
--
Stephen Jackson
More information about the Qt-interest-old
mailing list