TRACE log when we have to use fallback encoding

This commit is contained in:
jesopo 2018-10-17 16:54:33 +01:00
parent 69f9aab4b9
commit a4bfae9557

View file

@ -240,10 +240,12 @@ class Server(IRCObject.Object):
decoded_lines = []
for line in data_lines:
encoding = self.get_setting("encoding", "utf8")
try:
line = line.decode(self.get_setting(
"encoding", "utf8"))
line = line.decode(encoding)
except:
self.bot.log.trace("Cannot decode line with '%s', falling back",
[encoding])
try:
line = line.decode(self.get_setting(
"fallback-encoding", "latin-1"))