From b6490211b2cc2fa805c985ba2460fe773fd511b6 Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Fri, 11 May 2012 19:25:40 +0200 Subject: [PATCH] =?utf8?q?Des=20probl=C3=A8mes=20d'utf8=20quand=20il=20app?= =?utf8?q?rend=20=C3=A0=20compter?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- basile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basile.py b/basile.py index 4d330f3..6314b9c 100755 --- a/basile.py +++ b/basile.py @@ -776,7 +776,7 @@ class Basile(ircbot.SingleServerIRCBot): answer=random.choice(config_merci_answers) for ligne in answer.split("\n"): serv.privmsg(canal,"%s: %s"%(auteur,ligne.encode("utf8"))) - out=re.match(u"^([A-Z[]|\\|[0-9]+|(¹|²|³|⁴|⁵|⁶|⁷|⁸|⁹|⁰)+)(?:| \?| !)$", + out=re.match(ur"^([A-Z[]|\\|[0-9]+|(¹|²|³|⁴|⁵|⁶|⁷|⁸|⁹|⁰)+)(?:| \?| !)$", unicode(message.upper(),"utf8")) if out and not canal in self.quiet_channels: out=out.groups()[0] @@ -797,7 +797,7 @@ class Basile(ircbot.SingleServerIRCBot): serv.privmsg(canal,"%s: pfff, j'ai l'air malin maintenant… [ ?"%(auteur)) elif out in "[\\": serv.privmsg(canal,"%s: nan mais il faut qu'on arrête, ça va finir par poser des problèmes…"%(auteur)) - elif re.match(r"(¹|²|³|⁴|⁵|⁶|⁷|⁸|⁹|⁰)+",out): + elif re.match(ur"(¹|²|³|⁴|⁵|⁶|⁷|⁸|⁹|⁰)+",out): def translate(mess): return "".join([{u"⁰¹²³⁴⁵⁶⁷⁸⁹0123456789"[i]:u"0123456789⁰¹²³⁴⁵⁶⁷⁸⁹"[i] for i in range(20)}[j] -- 2.39.2