Permalink
Browse files

Fixes Issue #264 - sqlite utf-8 in db.insert function

  • Loading branch information...
1 parent cf66831 commit 809eeb08d9a8d900e141fccdf8386a55e3583a19 lmp committed Nov 13, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 web/db.py
View
3 web/db.py
@@ -1015,7 +1015,8 @@ def __init__(self, **keywords):
if db.__name__ in ["sqlite3", "pysqlite2.dbapi2"]:
db.paramstyle = 'qmark'
-
+ if db.__name__ in ["sqlite3"]:
+ db.register_adapter( str, lambda s:s.decode( 'utf-8' ) )
# sqlite driver doesn't create datatime objects for timestamp columns unless `detect_types` option is passed.
# It seems to be supported in sqlite3 and pysqlite2 drivers, not surte about sqlite.
keywords.setdefault('detect_types', db.PARSE_DECLTYPES)

0 comments on commit 809eeb0

Please sign in to comment.