Ensure log files are UTF-8 encoded

The default encoding is platform specific, so problems can arise if we do not
make it explicit. Especially on Windows. Freenode appears to be all UTF-8, and
irclib is giving us UTF-8 strings, so let's standardize on UTF-8.
This commit is contained in:
Richard Esplin 2014-01-15 23:15:09 -07:00
parent ba0ba71bf4
commit 5ecb154186

View File

@ -149,7 +149,7 @@ class ChannelLogger(callbacks.Plugin):
try:
name = self.getLogName(channel)
logDir = self.getLogDir(irc, channel)
log = open(os.path.join(logDir, name), 'a')
log = open(os.path.join(logDir, name), encoding='utf-8', mode='a')
logs[channel] = log
return log
except IOError: