Message87682
Confirmed here, tested with python2.6
on Linux with sys.stding.encoding == 'ISO-8859-1'
on Windows with sys.stdin.encoding == 'cp437'
>>> import sqlite3
>>> db = sqlite3.connect(':memory:')
>>> cur = db.cursor()
>>> cur.execute("create table foo (x)")
>>> cur.execute("insert into foo values ('café')")
>>> cur.execute("select * from foo")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
sqlite3.OperationalError: Could not decode to UTF-8 column 'x' with text
'café'
It seems that sqlite3 expects strings to be utf-8 encoded.
It works fine if you pass unicode strings, and with python 3.0. |
|
Date |
User |
Action |
Args |
2009-05-13 12:21:24 | amaury.forgeotdarc | set | recipients:
+ amaury.forgeotdarc, izarf |
2009-05-13 12:21:24 | amaury.forgeotdarc | set | messageid: <1242217284.64.0.348280350838.issue6010@psf.upfronthosting.co.za> |
2009-05-13 12:21:23 | amaury.forgeotdarc | link | issue6010 messages |
2009-05-13 12:21:22 | amaury.forgeotdarc | create | |
|