changeset 820:c0b243a72744

s/\'utf-8\'/config.charset/g
author Franz Pletz <fpletz AT franz-pletz DOT org>
date Sat, 10 Jun 2006 10:53:18 +0200
parents cbdf642bc58e
children ea1fc283b742
files MoinMoin/search.py
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/search.py	Sat Jun 10 10:48:33 2006 +0200
+++ b/MoinMoin/search.py	Sat Jun 10 10:53:18 2006 +0200
@@ -295,7 +295,7 @@
             # all parsed wikiwords, AND'ed
             queries = []
             for t in terms:
-                t = [i.encode('utf-8') for i in list(analyzer.tokenize(t))]
+                t = [i.encode(config.charset) for i in list(analyzer.tokenize(t))]
                 if len(t) < 2:
                     queries.append(xapian.Query(t[0]))
                 else:
@@ -374,8 +374,8 @@
             # all parsed wikiwords, AND'ed
             queries = []
             for t in terms:
-                t = [i.encode('utf-8') for i in list(analyzer.tokenize(t))]
-                t = ['%s%s' % (Xapian.Index.prefixMap['title'], i) for i in t]
+                t = ['%s%s' % (Xapian.Index.prefixMap['title'],
+                    i.encode(config.charset)) for i in list(analyzer.tokenize(t))]
                 if len(t) < 2:
                     queries.append(xapian.Query(t[0]))
                 else:
@@ -468,7 +468,9 @@
         if self.use_re:
             return None # xapian doesnt support regex search
         else:
-            term = xapian.Query(('%s%s' % (Xapian.Index.prefixMap['linkto'], pattern.lower())).encode('utf-8'))
+            term = xapian.Query(('%s%s' %
+                (Xapian.Index.prefixMap['linkto'],
+                    pattern.lower())).encode(config.charset))
             return term
 
 ############################################################################