[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyKDE] a little (big) problem with .ui - pyuic and unicode support :-(
From:       "Daniel R.C." <danielrc () prosystems-ibiza ! com>
Date:       2002-05-23 11:03:35
[Download RAW message or body]

Hello, -I'm not really good in english ... sorry- but I need some help,
please.

I explain my problem -and my not really good solution-, I hope somebody help
me :-)

I'm working with pyqt3.4.x + python2.2 + QtNC2.3 under win32 -but, this is
not a win32 problem-

I'm making a little NC aplication for french people. You know ... "ç é è ê"
I need a lot of not ASCII-7 symbols.

When I convert .ui into a .py .... the result like that:
**** .ui *****
    <property>
        <name>caption</name>
        <string>Gestion d''elèves</string>
    </property>
************

*****.py****
 self.setProperty('caption',QVariant(self.tr(QString.fromUtf8("Gestion
d''elèves"))))
***********

Ok. I know ... I need apply unicode() method to QString but ...

self.setProperty('caption',QVariant(self.tr(unicode(QString.fromUtf8("Gestio
n d''elèves")))))

don't work!! :-( ... I got a "UnicodeError: ASCII encoding error: ordinal
not in range(128)"

but ... when I try:

self.setProperty('caption',QVariant(self.tr(unicode(QString.fromLatin1("Gest
ion d'élèves")))))
all work rigth.

I know a bug in IDLE ... and the problem is another ... I don't use IDLE to
edit python code.
The problem with tr() in qt2.x ... and it's not a problem ... I don't have
any multilingual requeriment

The problem is I need use Latin1 and I need an script to "translate" every
è into a è ... and the same with all other simbols because the Utf8 don't
works fine :-(

I get the same problem when I read a text() or other text propierty .. I
need a complicated use of unicode.(Qstring).decode('latin1') ... or
unicode.(QString).encode('latin1') ...

Finally I get de result ok ... but I think you know a best way for work with
qt2.3.x in french or others languages.

You know? Somebody can share with me your own solution for this problem?

Thank you very much,
Daniel Rodriguez.

PS: Please send me a copy of reponse to me private mail :-)
danielrc@prosystems-ibiza.com I'm not suscribed to the list.
PSS: I read the mailing-archives, and I ask google for 1 week and I read the
How To Ask Questions The Smart Way ...

_______________________________________________
PyKDE mailing list    PyKDE@mats.gmd.de
http://mats.gmd.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic