From 9836ebf11f222bd42efecf6a18d466a80be8382a Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Mon, 26 Jul 2010 19:29:52 -0500 Subject: [PATCH] handle unicode escapes the right way, now that i properly looked up what was going on --- dr.botzo.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/dr.botzo.py b/dr.botzo.py index f7b40ee..dcf0340 100755 --- a/dr.botzo.py +++ b/dr.botzo.py @@ -181,17 +181,10 @@ class GoogleTranslate(Module): end_idx = translation.find('"}, "') translation = translation[:end_idx] - # do some text conversion - translation = translation.replace('\\u0026quot;', '"') - translation = translation.replace('\\u0026amp;', '&') - translation = translation.replace('\\u003c', '<') - translation = translation.replace('\\u003e', '>') - translation = translation.replace('\\u0026#39;', '\'') - if replypath is None: - return translation + return translation.decode('unicode_escape') else: - connection.privmsg(replypath, translation) + connection.privmsg(replypath, translation.decode('unicode_escape')) class Countdown(Module): """Class that adds a countdown item to the bot