--- /usr/share/hplip/base/logger.py.old 2012-10-01 15:57:23.788970745 +0200 +++ /usr/share/hplip/base/logger.py 2012-10-01 16:26:22.623529521 +0200 @@ -289,10 +289,16 @@ information = info + def _toutf8(self, message): + try: + return message.encode('utf-8') + except UnicodeDecodeError: + return message.decode('utf-8').encode('utf-8') + def warn(self, message): if self._level <= Logger.LOG_LEVEL_WARN: - txt = "warning: %s" % message.encode('utf-8') + txt = "warning: %s" % self._toutf8(message) self.log(self.color(txt, 'fuscia'), Logger.LOG_LEVEL_WARN) syslog.syslog(syslog.LOG_WARNING, "%s[%d]: %s" % (self.module, self.pid, txt))