aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/Cgi/admindb.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-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([' ', 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')