From de1239c36c6c0ce945dcbb1cff54666c9405ed76 Mon Sep 17 00:00:00 2001 From: stefan Date: Tue, 24 Nov 2009 20:26:52 +0000 Subject: [PATCH] Fix Issue2550609, hopefully for real, this time. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4388 57a73879-2fb5-44c3-a270-3262357dd7e2 --- roundup/backends/indexer_rdbms.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/roundup/backends/indexer_rdbms.py b/roundup/backends/indexer_rdbms.py index bb89cec..70e522b 100644 --- a/roundup/backends/indexer_rdbms.py +++ b/roundup/backends/indexer_rdbms.py @@ -64,11 +64,9 @@ class Indexer(IndexerBase): 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)] -- 2.30.2