handle unicode escapes the right way, now that i properly looked up what was going on

This commit is contained in:
Brian S. Stephan 2010-07-26 19:29:52 -05:00
parent 9eabef8abe
commit 9836ebf11f
1 changed files with 2 additions and 9 deletions

View File

@ -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