mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-02 23:54:07 +01:00
Merge pull request #442 from Athemis/master
Follow-up of pull-request #440
This commit is contained in:
commit
84a87e4307
@ -208,6 +208,10 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
|
|||||||
# on error, give up and replace the offending characters
|
# on error, give up and replace the offending characters
|
||||||
except UnicodeError:
|
except UnicodeError:
|
||||||
line = line.decode(errors='replace')
|
line = line.decode(errors='replace')
|
||||||
|
else:
|
||||||
|
# if no encoding could be guessed, fall back to utf-8 and
|
||||||
|
# replace offending characters
|
||||||
|
line = line.decode(encoding='utf-8', errors='replace')
|
||||||
# if chardet is not loaded, try to decode using utf-8 and replace any
|
# if chardet is not loaded, try to decode using utf-8 and replace any
|
||||||
# offending characters
|
# offending characters
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user