diff roundup/backends/back_sqlite.py @ 4091:09e79cbeb827

force sqlite3 in py2.6+ to treat our stored text as UTF-8
author Richard Jones <richard@users.sourceforge.net>
date Thu, 12 Mar 2009 04:29:16 +0000
parents 59d02edfaa9c
children 23ba17d01a24
line wrap: on
line diff
--- a/roundup/backends/back_sqlite.py	Thu Mar 12 03:04:10 2009 +0000
+++ b/roundup/backends/back_sqlite.py	Thu Mar 12 04:29:16 2009 +0000
@@ -108,6 +108,13 @@
         else:
             conn = sqlite.connect(db, timeout=30)
             conn.row_factory = sqlite.Row
+
+        # sqlite3 wants us to store Unicode in the db but that's not what's
+        # been done historically and it's definitely not what the other
+        # backends do, so we'll stick with UTF-8
+        if sqlite_version == 3:
+            conn.text_factory = str
+
         cursor = conn.cursor()
         return (conn, cursor)
 

Roundup Issue Tracker: http://roundup-tracker.org/