diff --git a/plugins/Filter/plugin.py b/plugins/Filter/plugin.py index b1f5137ea..09d66218a 100644 --- a/plugins/Filter/plugin.py +++ b/plugins/Filter/plugin.py @@ -196,7 +196,8 @@ class Filter(callbacks.Plugin): must be a string of hexadecimal digits. """ try: - irc.reply(self._hex_decoder(text.encode('utf8'))[0].decode('utf8')) + irc.reply(self._hex_decoder(text.encode('utf8'))[0] + .decode('utf8', 'replace')) except TypeError: irc.error(_('Invalid input.')) unhexlify = wrap(unhexlify, ['text']) diff --git a/plugins/Filter/test.py b/plugins/Filter/test.py index 1840a311c..fdea060db 100644 --- a/plugins/Filter/test.py +++ b/plugins/Filter/test.py @@ -102,6 +102,7 @@ class FilterTest(ChannelPluginTestCase): def testHexlifyUnhexlify(self): for s in map(str, range(1000, 1010)): self.assertResponse('unhexlify [hexlify %s]' % s, s) + self.assertNotError('unhexlify ff') def testScramble(self): s = 'the recalcitrant jamessan tests his scramble function'