[Python-3000] Bytes and unicode conversion in C extensions
Mike Klaas
mike.klaas at gmail.com
Tue Jul 29 22:29:19 CEST 2008
On 29-Jul-08, at 7:32 AM, Jesus Cea wrote:
>
> Working on the 3.0 version of bsddb, I have the following issue.
>
> Until 3.0, keys and values were strings. For bsddb, they are opaque,
> and
> stored unchanged.
>
> In 3.0 the string type is replaced by unicode. A new "byte" type is
> added. So, code like "db.put('key','value')" needs to be changed to
> "db.put(bytes('key', 'utf-8'), bytes('value', 'utf-8'))", or something
> similar.
You may find this thread to be relevant:
http://mail.python.org/pipermail/python-3000/2007-August/009197.html
-Mike
More information about the Python-3000
mailing list