From: stefan Date: Tue, 24 Nov 2009 20:26:52 +0000 (+0000) Subject: Fix Issue2550609, hopefully for real, this time. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=de1239c36c6c0ce945dcbb1cff54666c9405ed76;p=roundup.git 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 --- 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)]