From 92a8eba50503538086c30a323f814a561f0343ca Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 10 Dec 2011 15:46:25 +0200 Subject: [PATCH] Fix incorrect display of RFC2047 encoded names in Rmail summary buffers 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 | 8 ++++++++ lisp/mail/rmailsum.el | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c023f583d5f..024131569dc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2011-12-10 Eli Zaretskii + + * 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 * makefile.w32-in (update-subdirs-CMD): Use a Local Variables section. diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el index e6a0a34f33b..5c147be3104 100644 --- a/lisp/mail/rmailsum.el +++ b/lisp/mail/rmailsum.el @@ -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?= + ;; + (setq from (rfc2047-decode-string from)) (setq len (length from)) (setq mch (string-match "[@%]" from)) (format "%25s" -- 2.39.2