TRACE log when we have to use fallback encoding
This commit is contained in:
parent
69f9aab4b9
commit
a4bfae9557
1 changed files with 4 additions and 2 deletions
|
@ -240,10 +240,12 @@ class Server(IRCObject.Object):
|
||||||
decoded_lines = []
|
decoded_lines = []
|
||||||
|
|
||||||
for line in data_lines:
|
for line in data_lines:
|
||||||
|
encoding = self.get_setting("encoding", "utf8")
|
||||||
try:
|
try:
|
||||||
line = line.decode(self.get_setting(
|
line = line.decode(encoding)
|
||||||
"encoding", "utf8"))
|
|
||||||
except:
|
except:
|
||||||
|
self.bot.log.trace("Cannot decode line with '%s', falling back",
|
||||||
|
[encoding])
|
||||||
try:
|
try:
|
||||||
line = line.decode(self.get_setting(
|
line = line.decode(self.get_setting(
|
||||||
"fallback-encoding", "latin-1"))
|
"fallback-encoding", "latin-1"))
|
||||||
|
|
Loading…
Reference in a new issue