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 - - - - -

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] 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] 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.

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