From 431e0f2b4823e39acd5603c3a3223b4023adc4bd Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Thu, 7 Aug 2014 14:53:21 +0200 Subject: [PATCH] fix %searchquote on unicode strings --- contrib/boobot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/boobot.py b/contrib/boobot.py index ccf655ea..d87e5837 100755 --- a/contrib/boobot.py +++ b/contrib/boobot.py @@ -309,14 +309,14 @@ class Boobot(SingleServerIRCBot): def cmd_searchquote(self, nick, channel, text): try: - pattern = re.compile(text, re.IGNORECASE) + pattern = re.compile(to_unicode(text), re.IGNORECASE|re.UNICODE) except Exception as e: self.send_message(str(e), channel) return quotes = [] for quote in self.storage.get(channel, 'quotes', default=[]): - if pattern.search(quote['text']): + if pattern.search(to_unicode(quote['text'])): quotes.append(quote) try: