aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman
diff options
context:
space:
mode:
authorbwarsaw <>2003-12-27 00:56:44 +0000
committerbwarsaw <>2003-12-27 00:56:44 +0000
commit200ca2ebc9e16cd38c0aaecfe9f1a10333ead8c2 (patch)
tree6f90d3b62ab7520b05554f417a12c852edf6924a /Mailman
parent1dd9d148509cc2b47113e0381e67d74f3eb20460 (diff)
downloadmailman2-200ca2ebc9e16cd38c0aaecfe9f1a10333ead8c2.tar.gz
mailman2-200ca2ebc9e16cd38c0aaecfe9f1a10333ead8c2.tar.xz
mailman2-200ca2ebc9e16cd38c0aaecfe9f1a10333ead8c2.zip
show_helds_overview(), show_post_requests(): Another part of TK's
patch # 865661. Encode the subject header in the list's preferred character set and make sure it is all on one line.
Diffstat (limited to 'Mailman')
-rw-r--r--Mailman/Cgi/admindb.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/Mailman/Cgi/admindb.py b/Mailman/Cgi/admindb.py
index abafacca..d8092415 100644
--- a/Mailman/Cgi/admindb.py
+++ b/Mailman/Cgi/admindb.py
@@ -470,10 +470,12 @@ def show_helds_overview(mlist, form):
# handled by the time we got here.
mlist.HandleRequest(id, mm_cfg.DISCARD)
continue
+ dispsubj = Utils.oneline(
+ subject, Utils.GetCharSet(mlist.preferred_language))
t = Table(border=0)
t.AddRow([Link(admindburl + '?msgid=%d' % id, '[%d]' % counter),
Bold(_('Subject:')),
- Utils.websafe(subject)
+ Utils.websafe(dispsubj)
])
t.AddRow(['&nbsp;', Bold(_('Size:')), str(size) + _(' bytes')])
if reason:
@@ -589,6 +591,14 @@ def show_post_requests(mlist, id, info, total, count, form):
body = EMPTYSTRING.join(lines)[:mm_cfg.ADMINDB_PAGE_TEXT_LIMIT]
else:
body = EMPTYSTRING.join(lines)
+ # Get message charset and try encode in list charset
+ mcset = msg.get_param('charset', 'us-ascii').lower()
+ lcset = Utils.GetCharSet(mlist.preferred_language)
+ if mcset <> lcset:
+ try:
+ body = unicode(body, mcset).encode(lcset)
+ except (LookupError, UnicodeError):
+ pass
hdrtxt = NL.join(['%s: %s' % (k, v) for k, v in msg.items()])
hdrtxt = Utils.websafe(hdrtxt)
# Okay, we've reconstituted the message just fine. Now for the fun part!
@@ -596,7 +606,8 @@ def show_post_requests(mlist, id, info, total, count, form):
t.AddRow([Bold(_('From:')), sender])
row, col = t.GetCurrentRowIndex(), t.GetCurrentCellIndex()
t.AddCellInfo(row, col-1, align='right')
- t.AddRow([Bold(_('Subject:')), Utils.websafe(subject)])
+ t.AddRow([Bold(_('Subject:')),
+ Utils.websafe(Utils.oneline(subject, lcset))])
t.AddCellInfo(row+1, col-1, align='right')
t.AddRow([Bold(_('Reason:')), _(reason)])
t.AddCellInfo(row+2, col-1, align='right')