diff --git a/dr_botzo/transform/ircplugin.py b/dr_botzo/transform/ircplugin.py index a51c4c1..58d63ea 100644 --- a/dr_botzo/transform/ircplugin.py +++ b/dr_botzo/transform/ircplugin.py @@ -1,6 +1,7 @@ """Assorted text transformations (e.g. rot13).""" import base64 +import codecs from ircbot.lib import Plugin @@ -40,7 +41,8 @@ class Transform(Plugin): """Apply a rot13 method to the text.""" text = match.group(1) - return self.bot.reply(event, text.encode('rot13', 'ignore')) + encoder = codecs.getencoder('rot13') + return self.bot.reply(event, encoder(text)[0]) def handle_base64(self, connection, event, match): """Apply a base64 encoding to the text."""