Re: Unicode conversion problem (codec can't decode)

2008-04-04 Thread Eric S. Johansson
> > Almost there: use string-escape instead; it takes a byte string and > returns another byte string in ASCII. perfect. Exactly what I wanted. thank you so very much. > >> I really don't care about the character set used. I'm looking for a >> matched set >> of operations that converts t

Re: Unicode conversion problem (codec can't decode)

2008-04-04 Thread M.-A. Lemburg
On 2008-04-04 08:18, Jason Scheirer wrote: > On Apr 3, 9:35 pm, "Eric S. Johansson" <[EMAIL PROTECTED]> wrote: >> I'm having a problem (Python 2.4) converting strings with random 8-bit >> characters into an escape form which is 7-bit clean for storage in a >> database. If you don't want to proces

Re: Unicode conversion problem (codec can't decode)

2008-04-03 Thread Gabriel Genellina
En Fri, 04 Apr 2008 01:35:08 -0300, Eric S. Johansson <[EMAIL PROTECTED]> escribió: > I'm having a problem (Python 2.4) converting strings with random 8-bit > characters into an escape form which is 7-bit clean for storage in a > database. > Here's an example: > > body = meta['mini_body'].enco

Re: Unicode conversion problem (codec can't decode)

2008-04-03 Thread Jason Scheirer
On Apr 3, 9:35 pm, "Eric S. Johansson" <[EMAIL PROTECTED]> wrote: > I'm having a problem (Python 2.4) converting strings with random 8-bit > characters into an escape form which is 7-bit clean for storage in a database. > Here's an example: > > body = meta['mini_body'].encode('unicode-escape') > >

Unicode conversion problem (codec can't decode)

2008-04-03 Thread Eric S. Johansson
I'm having a problem (Python 2.4) converting strings with random 8-bit characters into an escape form which is 7-bit clean for storage in a database. Here's an example: body = meta['mini_body'].encode('unicode-escape') when given an 8-bit string, (in meta['mini_body']), the code fragment above