Re: Python Unicode to String conversion

2007-09-17 Thread Gabriel Genellina
En Mon, 17 Sep 2007 01:33:14 -0300, Richard Levasseur [EMAIL PROTECTED] escribi�: When dealing with unicode, i've run into situations where I have multiple encodings in the same string, usually latin1 and utf8 (latin1 != ascii, and latin1 != utf8, and they don't play nice together). So, for

Re: Python Unicode to String conversion

2007-09-16 Thread thijs . braem
Sorry for answering so late. Thanks a million! This code snippet helped me solve the problem. I think I will be using SQLAlchemy for these sorts of things from now on though, it seems to be taking care of these things itself, on top of being one hell of a handy ORM of course :) thijs On 1 sep,

Re: Python Unicode to String conversion

2007-09-16 Thread Richard Levasseur
On 1 sep, 09:17, iapain [EMAIL PROTECTED] wrote: First make sure your DB encoding is UTF-8 not the latin1 It took me days to figure out what was going on when dealing with unicode, ascii, latin1, utf8, decodeerrors, etc, so I'm just chiming in to echo something similar iapain's comments:

Re: Python Unicode to String conversion

2007-09-01 Thread iapain
First make sure your DB encoding is UTF-8 not the latin1 The error I keep having is something like this: ERREUR: Séquence d'octets invalide pour le codage «UTF8» : 0xe02063 then try this: def smart_str(s, encoding='utf-8', errors='strict'): Returns a bytestring version of 's',

Python Unicode to String conversion

2007-08-31 Thread thijs . braem
Hi everyone, I'm having quite some troubles trying to convert Unicode to String (for use in psycopg, which apparently doesn't know how to cope with unicode strings). The error I keep having is something like this: ERREUR: Séquence d'octets invalide pour le codage «UTF8» : 0xe02063 (sorry,

Re: Python Unicode to String conversion

2007-08-31 Thread Larry Bates
[EMAIL PROTECTED] wrote: Hi everyone, I'm having quite some troubles trying to convert Unicode to String (for use in psycopg, which apparently doesn't know how to cope with unicode strings). The error I keep having is something like this: ERREUR: Séquence d'octets invalide pour le

Re: Python Unicode to String conversion

2007-08-31 Thread Chris Mellon
On 8/31/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi everyone, I'm having quite some troubles trying to convert Unicode to String (for use in psycopg, which apparently doesn't know how to cope with unicode strings). The error I keep having is something like this: ERREUR: Séquence

Re: Python Unicode to String conversion

2007-08-31 Thread John Machin
On Sep 1, 8:55 am, [EMAIL PROTECTED] wrote: Hi everyone, I'm having quite some troubles trying to convert Unicode to String (for use in psycopg, which apparently doesn't know how to cope with unicode strings). The error I keep having is something like this: ERREUR: Séquence d'octets

Re: Python Unicode to String conversion

2007-08-31 Thread John Machin
On Sep 1, 9:56 am, Chris Mellon [EMAIL PROTECTED] wrote: On 8/31/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi everyone, I'm having quite some troubles trying to convert Unicode to String (for use in psycopg, which apparently doesn't know how to cope with unicode strings). The

Re: Python Unicode to String conversion

2007-08-31 Thread Carsten Haese
On Fri, 2007-08-31 at 15:55 -0700, [EMAIL PROTECTED] wrote: Hi everyone, I'm having quite some troubles trying to convert Unicode to String (for use in psycopg, which apparently doesn't know how to cope with unicode strings). The error I keep having is something like this: ERREUR:

Re: Python Unicode to String conversion

2007-08-31 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: The error I keep having is something like this: ERREUR: Séquence d'octets invalide pour le codage «UTF8» : 0xe02063 It would be useful to see some actual code snippet, traceback listing etc. --