Filter: Fix encoding with Python 3.

This commit is contained in:
Valentin Lorentz 2013-01-06 16:53:07 +01:00
parent 7e0d868db1
commit 418b3e007c
1 changed files with 4 additions and 1 deletions

View File

@ -29,6 +29,7 @@
###
import re
import sys
import codecs
import string
import random
@ -209,7 +210,9 @@ class Filter(callbacks.Plugin):
commonly used for text that simply needs to be hidden from inadvertent
reading by roaming eyes, since it's easily reversible.
"""
irc.reply(self._rot13_encoder(text.decode('utf8'))[0])
if sys.version_info[0] < 3:
text = text.decode('utf8')
irc.reply(self._rot13_encoder(text)[0])
rot13 = wrap(rot13, ['text'])
@internationalizeDocstring