diff --git a/dr_botzo/transform/ircplugin.py b/dr_botzo/transform/ircplugin.py index 58d63ea..87ddb93 100644 --- a/dr_botzo/transform/ircplugin.py +++ b/dr_botzo/transform/ircplugin.py @@ -51,9 +51,9 @@ class Transform(Plugin): text = match.group(2) if direction == 'encode': - return self.bot.reply(event, base64.encodestring(text).replace('\n', '')) + return self.bot.reply(event, base64.encodebytes(bytes(text, 'utf-8')).decode('utf-8')) elif direction == 'decode': - return self.bot.reply(event, base64.decodestring(text).replace('\n', '')) + return self.bot.reply(event, base64.decodebytes(bytes(text, 'utf-8')).decode('utf-8')) def handle_upper(self, connection, event, match): """Uppercase the text."""