summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 10c3f02)
raw | patch | inline | side by side (parent: 10c3f02)
author | stefan <stefan@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Tue, 24 Nov 2009 20:26:52 +0000 (20:26 +0000) | ||
committer | stefan <stefan@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Tue, 24 Nov 2009 20:26:52 +0000 (20:26 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4388 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/backends/indexer_rdbms.py | patch | blob | history |
index bb89ceca61240c0892e6bd3357e958f0b8d7218b..70e522b915823b11be46e5cfd3cca568791e92de 100644 (file)
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)]