Mercurial > p > roundup > code
changeset 3415:4a228402b810
Handle invalidly-specified charsets in incoming email
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Wed, 28 Sep 2005 05:48:23 +0000 |
| parents | 89a5c8e86346 |
| children | 07c696890f55 |
| files | CHANGES.txt roundup/mailgw.py |
| diffstat | 2 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/CHANGES.txt Wed Sep 28 05:42:23 2005 +0000 +++ b/CHANGES.txt Wed Sep 28 05:48:23 2005 +0000 @@ -15,6 +15,9 @@ Fixed: - Display of Multilinks where linked Class labelprop values are None - Fix references to the old * Registration Permissions +- Fix missing merge of fix to sf bug 1177057 +- Fix RDBMS indexer indexing UTF-8 words that encode to > 30 chars +- Handle invalidly-specified charsets in incoming email 2005-07-18 0.8.4
--- a/roundup/mailgw.py Wed Sep 28 05:42:23 2005 +0000 +++ b/roundup/mailgw.py Wed Sep 28 05:48:23 2005 +0000 @@ -72,7 +72,7 @@ an exception, the original message is bounced back to the sender with the explanatory message given in the exception. -$Id: mailgw.py,v 1.166 2005-06-24 07:16:01 richard Exp $ +$Id: mailgw.py,v 1.167 2005-09-28 05:48:23 richard Exp $ """ __docformat__ = 'restructuredtext' @@ -223,8 +223,9 @@ # Encode message to unicode charset = rfc2822.unaliasCharset(self.getparam("charset")) if charset: - # Do conversion only if charset specified - edata = unicode(data, charset).encode('utf-8') + # Do conversion only if charset specified - handle + # badly-specified charsets + edata = unicode(data, charset, 'replace').encode('utf-8') # Convert from dos eol to unix edata = edata.replace('\r\n', '\n') else:
