changeset 4284:86e8b2a615fa

Fix Issue2550609, hopefully for real, this time.
author Stefan Seefeld <stefan@seefeld.name>
date Tue, 24 Nov 2009 20:26:52 +0000
parents fd28b1f291dd
children 783053bd466c
files roundup/backends/indexer_rdbms.py
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/roundup/backends/indexer_rdbms.py	Tue Nov 24 20:20:14 2009 +0000
+++ b/roundup/backends/indexer_rdbms.py	Tue Nov 24 20:26:52 2009 +0000
@@ -64,11 +64,9 @@
             self.db.cursor.execute(sql, (id, ))
 
         # ok, find all the unique words in the text
-        def tryencode(str):
-            if not isinstance(str, unicode):
-                str = str.encode("utf-8", "replace")
-            return str
-        text = tryencode(text).upper()
+        if not isinstance(text, unicode):
+            text = unicode(text, "utf-8", "replace")
+        text = text.upper()
         wordlist = [w.encode("utf-8")
                     for w in re.findall(r'(?u)\b\w{%d,%d}\b'
                                         % (self.minlength, self.maxlength), text)]

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