Update of /cvsroot/mailman/mailman/Mailman/Cgi
In directory sc8-pr-cvs1:/tmp/cvs-serv21955

Modified Files:
      Tag: Release_2_1-maint
        admindb.py 
Log Message:
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.


Index: admindb.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Cgi/admindb.py,v
retrieving revision 2.45.2.3
retrieving revision 2.45.2.4
diff -u -d -r2.45.2.3 -r2.45.2.4
--- admindb.py  22 Dec 2003 18:52:29 -0000      2.45.2.3
+++ admindb.py  27 Dec 2003 00:56:44 -0000      2.45.2.4
@@ -470,10 +470,12 @@
                 # 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 @@
         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 @@
     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')



_______________________________________________
Mailman-checkins mailing list
[EMAIL PROTECTED]
Unsubscribe: http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to