skip bad utf-8 for users

git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@927 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
(no author)
2007-12-22 08:05:40 +00:00
parent a55ee949da
commit f86b19f8f7
+5 -1
View File
@@ -221,7 +221,6 @@ class etpDatabase:
# if the database is opened readonly, we don't need to lock the online status
self.connection = sqlite.connect(dbFile)
self.cursor = self.connection.cursor()
# set the table read only
return
if (self.readOnly):
@@ -2108,6 +2107,11 @@ class etpDatabase:
self.createContentIndex() # FIXME: remove this with 1.0
# protect user from having a bad day
# developers can solve bad utf-8 data (and MUST), so we won't skip bad chars for them
if self.clientDatabase:
self.connection.text_factory = lambda x: unicode(x, "utf-8", "ignore")
extstring = ''
if extended:
extstring = ",type"