From f7d3b5f6256358e6ccef51e9926214e13cea676a Mon Sep 17 00:00:00 2001 From: mutantmonkey Date: Mon, 6 Feb 2012 22:58:53 -0500 Subject: [PATCH] potential fix for unicode crash --- irc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/irc.py b/irc.py index 048fa87..fab33d8 100755 --- a/irc.py +++ b/irc.py @@ -126,7 +126,10 @@ class Bot(asynchat.async_chat): line = line[:-1] self.buffer = b'' - line = line.decode('utf-8') + try: + line = line.decode('utf-8') + except UnicodeDecodeError: + line = line.decode('iso-8859-1') if line.startswith(':'): source, line = line[1:].split(' ', 1)