Re: [PyKDE] unicode two-way conversion

2005-10-25 Thread rajeev_jsv
On Wednesday 26 October 2005 2:57 am, Sundance wrote: > I heard Sebastian Kügler said: > > So what I basically need is a two-way conversion between unicode > > strings and ascii (or at least something that is easily usable > > together with psycopg and postgres' character fields. from Unicode to 8

Re: [PyKDE] unicode two-way conversion

2005-10-25 Thread Sebastian Kügler
On Tuesday 25 October 2005 23:27, Sundance wrote: > You most probably want to read this: > http://www.joelonsoftware.com/articles/Unicode.html Thanks, it's a good read and filled me in on some wholes. Cheers, -- sebas http://www.kde.nl | http://vizZzion.org | GPG Key ID: 9119 0EF9 - - - - -

[PyKDE] SIP: difference between TransferBack and Factory

2005-10-25 Thread Giovanni Bajo
Hello, Having read the SIP documentation, it is not clear to me what is the difference between using TransferBack and using Factory as annotation for a function. It *looks* like Factory should be used for new objects, and TransferBack for objects that existed "before" (for some meaning of before).

Re: [PyKDE] unicode two-way conversion

2005-10-25 Thread Sundance
I heard Sebastian Kügler said: > So what I basically need is a two-way conversion between unicode > strings and ascii (or at least something that is easily usable > together with psycopg and postgres' character fields. Hello Sebastian, You most probably want to read this: http://www.joelonsoftwa

Re: [PyKDE] unicode two-way conversion

2005-10-25 Thread Sebastian Kügler
On Tuesday 25 October 2005 14:39, Diez B. Roggisch wrote: > > Ah, that helps the problem in my test script. Now I'm encountering a > > problem encoding the input of a QLineedit: > > > > File "john.py", line 154, in dataFromGuiToUser > > self.user.data["achternaam"] = > > self.GAchternaam.text

Re: [PyKDE] installig of SIP

2005-10-25 Thread David Boddie
On Tue, 25 Oct 2005 11:24:48, Nguessan KRE wrote: >Please help me. I can not installing SIP-4.3.1 on my >computer. bellow the message of error: > >[EMAIL PROTECTED] sip-4.3.1]# python configure.py -l qt >This is SIP 4.3.1 for Python 2.4.2 on linux2. [...] I may be completely wrong her

[PyKDE] installig of SIP-4.3.1

2005-10-25 Thread Nguessan KRE
Hello, Please help me. I can not installing SIP-4.3.1 on my computer. bellow the message of error: [EMAIL PROTECTED] sip-4.3.1]# python configure.py -l qt This is SIP 4.3.1 for Python 2.4.2 on linux2. The SIP code generator will be installed in /usr/local/bin. The SIP module will be installed in

Re: [PyKDE] Update on QStrings and PyQt4

2005-10-25 Thread Phil Thompson
> Phil Thompson <[EMAIL PROTECTED]> wrote: > >> A lot of interoperability improvements have been made in current PyQt3 >> snapshots. I've just implemented the buffer interface for QString and >> the >> following now work: >> >> f = open(QString("Qt"), "r") "foobar".find(QString("bar")) >> "

Re: [PyKDE] unicode two-way conversion

2005-10-25 Thread Giovanni Bajo
Sebastian Kügler <[EMAIL PROTECTED]> wrote: > File "john.py", line 154, in dataFromGuiToUser > self.user.data["achternaam"] = self.GAchternaam.text().encode('utf-8', > 'strict') > AttributeError: encode > > So the problem is that I'm not able to convert the QString to utf-8 (without > making

Re: [PyKDE] unicode two-way conversion

2005-10-25 Thread Hans-Peter Jansen
Am Dienstag, 25. Oktober 2005 12:48 schrieb Sebastian Kügler: > On Tuesday 25 October 2005 12:28, Mateusz Korniak wrote: > > > > Encode to (and back from) utf-8. > > Remember only that utf-8 representation is longer than number of > > chars in unicode string if any non 7bit ascii char is used. > >

Re: [PyKDE] Update on QStrings and PyQt4

2005-10-25 Thread Giovanni Bajo
Phil Thompson <[EMAIL PROTECTED]> wrote: > A lot of interoperability improvements have been made in current PyQt3 > snapshots. I've just implemented the buffer interface for QString and the > following now work: > > f = open(QString("Qt"), "r") "foobar".find(QString("bar")) > "fooxxx".repl

Re: [PyKDE] unicode two-way conversion

2005-10-25 Thread Giovanni Bajo
Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Then you need to _decode_ it as utf-8 to yield a unicode object. So the > whole line should read > > self.user.data["achternaam"] = > self.GAchternaam.text().utf8().decode('utf-8') You're working way too hard to get an unicode string out of a QString

Re: [PyKDE] unicode two-way conversion

2005-10-25 Thread Diez B. Roggisch
> Ah, that helps the problem in my test script. Now I'm encountering a > problem encoding the input of a QLineedit: > > File "john.py", line 154, in dataFromGuiToUser > self.user.data["achternaam"] = self.GAchternaam.text().encode('utf-8', > 'strict') > AttributeError: encode text() returns

Re: [PyKDE] unicode two-way conversion

2005-10-25 Thread Sebastian Kügler
On Tuesday 25 October 2005 12:28, Mateusz Korniak wrote: > > When I read the data from the widget, I'm not able to insert strings into > > the database using unicode. I can replace the offending characters with > > 'string'.encode('ascii', 'xmlcharrefreplace'). > > Encode to (and back from) utf-8.

[PyKDE] SIP Cygwin support [PATCH]

2005-10-25 Thread Yaakov S (Cygwin Ports)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'm attaching a patch for sip-4.3.1 which fixes compilation on Cygwin with our X11 port of Qt3. With this patch to sip, PyQt builds OOTB. Cygwin packages are available at: ftp://sunsite.dk/projects/cygwinports/release/KDE/qscintilla/ ftp://sunsite.dk

[PyKDE] installig of SIP

2005-10-25 Thread Nguessan KRE
Hello, Please help me. I can not installing SIP-4.3.1 on my computer. bellow the message of error: [EMAIL PROTECTED] sip-4.3.1]# python configure.py -l qt This is SIP 4.3.1 for Python 2.4.2 on linux2. The SIP code generator will be installed in /usr/local/bin. The SIP module will be installed in

Re: [PyKDE] unicode two-way conversion

2005-10-25 Thread Mateusz Korniak
On Tuesday 25 of October 2005 12:13, Sebastian Kügler wrote: > Hi, > > (I'm posting to this list since I think it's likely that someone here ran > across the same problem.) > > I'm working on a database frontend for a postgresql database, and I'm > having an issue with unicode characters that I've

[PyKDE] unicode two-way conversion

2005-10-25 Thread Sebastian Kügler
Hi, (I'm posting to this list since I think it's likely that someone here ran across the same problem.) I'm working on a database frontend for a postgresql database, and I'm having an issue with unicode characters that I've put into the Qt UI. When I read the data from the widget, I'm not able