potential fix for unicode crash
parent
e21b2f6ec7
commit
f7d3b5f625
3
irc.py
3
irc.py
|
@ -126,7 +126,10 @@ class Bot(asynchat.async_chat):
|
||||||
line = line[:-1]
|
line = line[:-1]
|
||||||
self.buffer = b''
|
self.buffer = b''
|
||||||
|
|
||||||
|
try:
|
||||||
line = line.decode('utf-8')
|
line = line.decode('utf-8')
|
||||||
|
except UnicodeDecodeError:
|
||||||
|
line = line.decode('iso-8859-1')
|
||||||
|
|
||||||
if line.startswith(':'):
|
if line.startswith(':'):
|
||||||
source, line = line[1:].split(' ', 1)
|
source, line = line[1:].split(' ', 1)
|
||||||
|
|
Loading…
Reference in New Issue