GNU bug report logs - #56513
28.1; Vcard in a mime part with a utf-8 charset is displayed incorrectly

Previous Next

Package: emacs;

Reported by: Pascal Quesseveur <quesseveur <at> abaksystemes.fr>

Date: Tue, 12 Jul 2022 06:35:02 UTC

Severity: normal

Found in version 28.1

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 56513 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Pascal Quesseveur <quesseveur <at> abaksystemes.fr>
Cc: 56513 <at> debbugs.gnu.org
Subject: Re: bug#56513: 28.1; Vcard in a mime part with a utf-8 charset is
 displayed incorrectly
Date: Tue, 12 Jul 2022 15:02:00 +0200
Pascal Quesseveur <quesseveur <at> abaksystemes.fr> writes:

>     (mm-insert-inline
>      handle
>      (concat "\n-- \n"
>              (if (and charset text)
>                  (mm-decode-string (string-make-unibyte text) charset)
>                text)))))
>
> When I use this function in mm-inline-media-tests display is OK.

Thanks.  I think it would be better to decode the data before handling
it to the vcard functions, so I've reworked the function that way
instead.

Can you check whether this fixes the problem, too?

diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el
index 57ce36a944..1bfef637bf 100644
--- a/lisp/gnus/mm-view.el
+++ b/lisp/gnus/mm-view.el
@@ -366,16 +366,15 @@ mm-inline-text-html
 	(apply (car func) handle (cdr func)))))))
 
 (defun mm-inline-text-vcard (handle)
-  (let ((inhibit-read-only t))
-    (mm-insert-inline
-     handle
-     (concat "\n-- \n"
-	     (ignore-errors
-	       (if (fboundp 'vcard-pretty-print)
-		   (vcard-pretty-print (mm-get-part handle))
-		 (vcard-format-string
-		  (vcard-parse-string (mm-get-part handle)
-				      'vcard-standard-filter))))))))
+  (let* ((inhibit-read-only t)
+         (charset (mail-content-type-get (mm-handle-type handle) 'charset))
+         (data (mm-decode-string (mm-get-part handle) charset))
+         (text (and data
+                    (if (fboundp 'vcard-pretty-print)
+                        (vcard-pretty-print data)
+                      (vcard-format-string
+                       (vcard-parse-string data 'vcard-standard-filter))))))
+    (mm-insert-inline handle (concat "\n-- \n" text))))
 
 (defun mm-inline-text (handle)
   (let ((b (point))


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 3 years and 8 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.