utils: relax conversion to unicode
[imapami.git] / imapami / utils.py
index 291b71f..4af970c 100644 (file)
@@ -76,7 +76,7 @@ def headers_to_unicode(headers):
         if encoding is None:
             value = unicode(value)
         else:
-            value = value.decode(encoding)
+            value = value.decode(encoding, errors="replace")
         unicode_headers[key] = value
     return unicode_headers