]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix incorrect display of RFC2047 encoded names in Rmail summary buffers
authorEli Zaretskii <eliz@gnu.org>
Sat, 10 Dec 2011 13:46:25 +0000 (15:46 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 10 Dec 2011 13:46:25 +0000 (15:46 +0200)
 lisp/mail/rmailsum.el (rmail-header-summary): RFC2047 decode the
 `from' or `to' address before taking its substring.  Fixes
 incorrect display in Rmail summary buffer whereby an RFC2047
 encoded name is chopped in the middle of the encoded string, and
 thus displayed encoded.

lisp/ChangeLog
lisp/mail/rmailsum.el

index c023f583d5f57f9120b8e4dfb2f62e3a8ba5290e..024131569dc0c4ca051b1e2dcd59ef8ecfc616dc 100644 (file)
@@ -1,3 +1,11 @@
+2011-12-10  Eli Zaretskii  <eliz@gnu.org>
+
+       * mail/rmailsum.el (rmail-header-summary): RFC2047 decode the
+       `from' or `to' address before taking its substring.  Fixes
+       incorrect display in Rmail summary buffer whereby an RFC2047
+       encoded name is chopped in the middle of the encoded string, and
+       thus displayed encoded.
+
 2011-12-10  Juanma Barranquero  <lekktu@gmail.com>
 
        * makefile.w32-in (update-subdirs-CMD): Use a Local Variables section.
index e6a0a34f33b6e2d15f98887629dd407744c670b6..5c147be310405a962396ed94cd4dac6c07e13c00 100644 (file)
@@ -762,6 +762,12 @@ the message being processed."
                                              (point)))))))))
               (if (null from)
                   "                         "
+                ;; We are going to return only 25 characters of the
+                ;; address, so make sure it is RFC2047 decoded before
+                ;; taking its substring.  This is important when the address is not on the same line as the name, e.g.:
+                ;; To: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?=
+                ;; <stepnem@gmail.com>
+                (setq from (rfc2047-decode-string from))
                 (setq len (length from))
                 (setq mch (string-match "[@%]" from))
                 (format "%25s"