string to unicode Was: Issue with database Postgresql :(

2007-05-09 Thread Thomas Guettler
Am Dienstag, 8. Mai 2007 22:54 schrieb Gerard M: > Thanks for all your help guys, but I'm facing another little thing > here, if I'm getting the word from a file (this means I'm not typing > the word directly into the code), for example: Maybe this helps: s="München" # simple string

Re: Issue with database Postgresql :(

2007-05-08 Thread Kenneth Gonsalves
On 08-May-07, at 10:43 PM, Gerard M wrote: > I dont know if something like this exists in postgresql, or if there > is something else I can do or I should be doing, thanks for your help, > and your time for reading this post. when creating the database, do createdb dbname -E=unicode -- regar

Re: Issue with database Postgresql :(

2007-05-08 Thread Malcolm Tredinnick
On Tue, 2007-05-08 at 10:13 -0700, Gerard M wrote: > Hello dear django community, I'm having a bad time with an issue that > I haven't been able to solve with my database, the problem is this: > Whenever I try to save a word containing "special" characters in it > (for example áéíóú) I get the fol

Re: Issue with database Postgresql :(

2007-05-08 Thread Joseph Heck
Using django syncdb is fine - just make sure the database itself is set up with utf-8 encoding. I used that very command just prior to running "django-admin.py syncdb" You might check the archives of this group for similiar topics - I recall seeing discussion on this previously, and I think they

Re: Issue with database Postgresql :(

2007-05-08 Thread Joseph Heck
You need to deal with whatever encoding the file is in. But you're also running out of my area of knowledge in regards to text encodings. -joe On 5/8/07, Gerard M <[EMAIL PROTECTED]> wrote: > > Thanks for all your help guys, but I'm facing another little thing > here, if I'm getting the word fro

Re: Issue with database Postgresql :(

2007-05-08 Thread Gerard M
Thanks for all your help guys, but I'm facing another little thing here, if I'm getting the word from a file (this means I'm not typing the word directly into the code), for example: for line in textf: tempwords = line.split(None) for c in range(len(tempwords)):

Re: Issue with database Postgresql :(

2007-05-08 Thread Joseph Heck
You'd want to write that as w = u'ataché' to make sure python knew you were pushing out a unicode string, but an ASCII string. -joe On 5/8/07, Gerard M <[EMAIL PROTECTED]> wrote: > > Thanks for your help Rafael, but I got into another trouble trying to > encode my string like this; > I have th

Re: Issue with database Postgresql :(

2007-05-08 Thread Gerard M
Thanks for your help Rafael, but I got into another trouble trying to encode my string like this; I have the unicode string in a variable lets say w = ataché, how can I tell python/django that the string "w" is a unicode string and how can I make the encoding, because If I type w.encode('utf-8'),

Re: Issue with database Postgresql :(

2007-05-08 Thread Rafael \"SDM\" Sierra
On 5/8/07, Gerard M <[EMAIL PROTECTED]> wrote: > > Well I did not create the table myself on postgreSQL, I used django > manage.py syncdb and that created my database from my models, and I > have to build it like that because thats the way I access to the > tables too, so I need to find a way to al

Re: Issue with database Postgresql :(

2007-05-08 Thread Gerard M
Well I did not create the table myself on postgreSQL, I used django manage.py syncdb and that created my database from my models, and I have to build it like that because thats the way I access to the tables too, so I need to find a way to alter them or to set a collation or to change the "client_

Re: Issue with database Postgresql :(

2007-05-08 Thread Joseph Heck
when you created your database, did you set the encoding to UTF-8? When we set up our database, we used: createdb -E='utf-8' -Upostuser databasename I'm not familiar enough to Postgres to know if you can convert the encoding of a database after it's been created. -joe On 5/8/07, Gerard M <

Issue with database Postgresql :(

2007-05-08 Thread Gerard M
Hello dear django community, I'm having a bad time with an issue that I haven't been able to solve with my database, the problem is this: Whenever I try to save a word containing "special" characters in it (for example áéíóú) I get the following django error: "invalid byte sequence for encoding "U