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

Open
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+2 −1
Split
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)