From eeb8ff83bf87ec202b4ebe26e05093320b7f7ed2 Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Wed, 27 Oct 2010 23:16:07 -0500 Subject: [PATCH] fix a lack of encoding bug in a place where it's probably been lingering for a while. --- dr.botzo.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dr.botzo.py b/dr.botzo.py index f153b3c..538b65e 100644 --- a/dr.botzo.py +++ b/dr.botzo.py @@ -52,7 +52,10 @@ class DrBotServerConnection(irclib.ServerConnection): splitpos = text.rfind(' ', 0, splitspace) splittext = text[0:splitpos] + ' ' + splitter text = splitter + ' ' + text[splitpos+1:] - self.send_raw("PRIVMSG %s :%s" % (target, unicode(splittext).encode('utf-8'))) + try: + splittext = unicode(splittext).encode('utf-8') + except UnicodeDecodeError: pass + self.send_raw("PRIVMSG %s :%s" % (target, splittext)) times = times + 1 if times >= 4: