File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 1010- Fix references to the old * Registration Permissions
1111- Fix missing merge of fix to sf bug 1177057
1212- Fix RDBMS indexer indexing UTF-8 words that encode to > 30 chars
13+ - Handle invalidly-specified charsets in incoming email
1314
1415
15162005-07-18 0.8.4
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ class node. Any parts of other types are each stored in separate files
7272an exception, the original message is bounced back to the sender with the
7373explanatory message given in the exception.
7474
75- $Id: mailgw.py,v 1.159.2.7 2005-09-26 02:14:07 richard Exp $
75+ $Id: mailgw.py,v 1.159.2.8 2005-09-28 05:49:23 richard Exp $
7676"""
7777__docformat__ = 'restructuredtext'
7878
@@ -223,8 +223,9 @@ def getbody(self):
223223 # Encode message to unicode
224224 charset = rfc2822 .unaliasCharset (self .getparam ("charset" ))
225225 if charset :
226- # Do conversion only if charset specified
227- edata = unicode (data , charset ).encode ('utf-8' )
226+ # Do conversion only if charset specified - handle
227+ # badly-specified charsets
228+ edata = unicode (data , charset , 'replace' ).encode ('utf-8' )
228229 # Convert from dos eol to unix
229230 edata = edata .replace ('\r \n ' , '\n ' )
230231 else :
You can’t perform that action at this time.
0 commit comments