Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Open
wants to merge 1 commit into from

1 participant

Larpon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 13, 2013
  1. Larpon
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  web/db.py
3  web/db.py
View
@@ -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)
Something went wrong with that request. Please try again.