Re: getquoted and unicode

From: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
To: psycopg(at)postgresql(dot)org
Subject: Re: getquoted and unicode
Date: 2011-01-23 11:54:26
Message-ID: 20110123115426.GC2360@hermes.hilbert.loc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

On Sun, Jan 23, 2011 at 12:42:42PM +0100, Karsten Hilbert wrote:

> > import psycopg2
> >
> > psycopg2.extensions.register_type(psycopg2.extensions.UNICODE)
> > adapted = psycopg2.extensions.adapt(u'test')
> > adapted.getquoted()
>
> That is strange because:
>
> adapted.adapted.encode(adapted.encoding)
>
> works just fine.

And

adapted.adapted being u'test'
adapted.encoding being 'latin-1'

Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

In response to

Browse psycopg by date

  From Date Subject
Next Message Daniele Varrazzo 2011-01-23 12:44:36 Re: getquoted and unicode
Previous Message Karsten Hilbert 2011-01-23 11:42:42 Re: getquoted and unicode