Message87682
| 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: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 |
|