From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: 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 Message-ID: <874jzmzdpz.fsf@gnus.org> References: <82o7xudelx.fsf@abaksystemes.fr> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1388"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 56513@debbugs.gnu.org To: Pascal Quesseveur Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 12 15:28:15 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBFvx-00005t-Qy for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 12 Jul 2022 15:28:13 +0200 Original-Received: from localhost ([::1]:58120 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBFvw-0003Gb-K9 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 12 Jul 2022 09:28:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58104) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBFXa-00032S-AW for bug-gnu-emacs@gnu.org; Tue, 12 Jul 2022 09:03:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48002) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oBFXZ-00015Q-TX for bug-gnu-emacs@gnu.org; Tue, 12 Jul 2022 09:03:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oBFXZ-0001XN-PX for bug-gnu-emacs@gnu.org; Tue, 12 Jul 2022 09:03:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Jul 2022 13:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56513 X-GNU-PR-Package: emacs Original-Received: via spool by 56513-submit@debbugs.gnu.org id=B56513.16576309325844 (code B ref 56513); Tue, 12 Jul 2022 13:03:01 +0000 Original-Received: (at 56513) by debbugs.gnu.org; 12 Jul 2022 13:02:12 +0000 Original-Received: from localhost ([127.0.0.1]:41899 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oBFWm-0001WC-Fz for submit@debbugs.gnu.org; Tue, 12 Jul 2022 09:02:12 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:36822) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oBFWk-0001Vx-Qp for 56513@debbugs.gnu.org; Tue, 12 Jul 2022 09:02:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=CL4SDM1nakPj8m9704a9LKIc1fiWcA6d9D+7TAD/jU8=; b=XIy5JwjQwFF9TvjTqU+uAjUu/v /enynjawt4yomb7lsl4GbIDAo0Y/E9gHo00+6E2U7GXPIRgPrTOmgnn1t1GkT/zBYVTkJs0pOcD9G Ptp/XHLg1hUyKM6Jajocov8YO6qhC+MXMMAnuYbAeN6gGrGswYz8Sik2YiL6G8i2MG60=; Original-Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBFWb-0007XO-Eb; Tue, 12 Jul 2022 15:02:04 +0200 In-Reply-To: <82o7xudelx.fsf@abaksystemes.fr> (Pascal Quesseveur's message of "Tue, 12 Jul 2022 08:33:46 +0200") X-Now-Playing: Robyn ft. Mapei's _The Versions_: "Buffalo Stance" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:236769 Archived-At: Pascal Quesseveur 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