diff options
author | tkikuchi <> | 2004-10-19 04:34:06 +0000 |
---|---|---|
committer | tkikuchi <> | 2004-10-19 04:34:06 +0000 |
commit | 175409e0f4d3b619895b6339971543d28a14d1e1 (patch) | |
tree | c9990b945424d4d008d37f297edb6568b8c34f7b /Mailman/Handlers/ToDigest.py | |
parent | 91b9c2e380c3a2b2b72e15669b8c4ea63751d3fd (diff) | |
download | mailman2-175409e0f4d3b619895b6339971543d28a14d1e1.tar.gz mailman2-175409e0f4d3b619895b6339971543d28a14d1e1.tar.xz mailman2-175409e0f4d3b619895b6339971543d28a14d1e1.zip |
923428 VERP subscription confirmations
960551 Bug: Plain digest with mixed charsets
995029 Patch against Mailman 2.1.5 release fixes bug #913397
Diffstat (limited to 'Mailman/Handlers/ToDigest.py')
-rw-r--r-- | Mailman/Handlers/ToDigest.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Mailman/Handlers/ToDigest.py b/Mailman/Handlers/ToDigest.py index 2f64b369..9051e846 100644 --- a/Mailman/Handlers/ToDigest.py +++ b/Mailman/Handlers/ToDigest.py @@ -39,6 +39,7 @@ from email.MIMEText import MIMEText from email.MIMEMessage import MIMEMessage from email.Utils import getaddresses from email.Header import decode_header, make_header, Header +from email.Charset import Charset from Mailman import mm_cfg from Mailman import Utils @@ -137,9 +138,11 @@ def send_digests(mlist, mboxfp): def send_i18n_digests(mlist, mboxfp): mbox = Mailbox(mboxfp) - # Prepare common information + # Prepare common information (first lang/charset) lang = mlist.preferred_language lcset = Utils.GetCharSet(lang) + lcset_out = Charset(lcset).output_charset + # Common Information (contd) realname = mlist.real_name volume = mlist.volume issue = mlist.next_digest_number @@ -316,6 +319,10 @@ def send_i18n_digests(mlist, mboxfp): print >> plainmsg payload = msg.get_payload(decode=True)\ or msg.as_string().split('\n\n',1)[1] + mcset = msg.get_content_charset('') + if mcset and mcset <> lcset and mcset <> lcset_out: + payload = unicode(payload, mcset, 'replace' + ).encode(lcset, 'replace') print >> plainmsg, payload if not payload.endswith('\n'): print >> plainmsg |