This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author amaury.forgeotdarc
Recipients amaury.forgeotdarc, izarf
Date 2009-05-13.12:21:22
SpamBayes Score 7.0475292e-12
Marked as misclassified No
Message-id <1242217284.64.0.348280350838.issue6010@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2009-05-13 12:21:24amaury.forgeotdarcsetrecipients: + amaury.forgeotdarc, izarf
2009-05-13 12:21:24amaury.forgeotdarcsetmessageid: <1242217284.64.0.348280350838.issue6010@psf.upfronthosting.co.za>
2009-05-13 12:21:23amaury.forgeotdarclinkissue6010 messages
2009-05-13 12:21:22amaury.forgeotdarccreate