From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.bugs Subject: bug#35507: Gnus mojibakifies UTF-8 text/x-patch attachments from Thunderbird Date: Thu, 02 May 2019 17:10:40 +0100 Message-ID: <8736lw25xb.fsf@tcd.ie> References: <44a26585-7980-378c-9262-a567ddd3e617@cs.ucla.edu> <865zqv3tc2.fsf@gmail.com> <838svqqdp2.fsf@gnu.org> <87d0l1o8p7.fsf@gmail.com> <86v9ytz5nk.fsf@gmail.com> <2133CEDA-748F-44F0-901B-D7213645369A@gnu.org> <83ftpwq270.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="253626"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 35507@debbugs.gnu.org, Andy Moreton To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu May 02 18:11:24 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hMEIt-0013YG-37 for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 May 2019 18:11:23 +0200 Original-Received: from localhost ([127.0.0.1]:53968 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMEIh-00039D-Mn for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 May 2019 12:11:11 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:42466) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMEIZ-000388-4n for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 12:11:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMEIY-0001Zg-1f for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 12:11:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33274) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hMEIX-0001Za-UZ for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 12:11:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hMEIX-0007Yi-ON; Thu, 02 May 2019 12:11:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Thu, 02 May 2019 16:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35507 X-GNU-PR-Package: emacs,gnus Original-Received: via spool by 35507-submit@debbugs.gnu.org id=B35507.155681345229039 (code B ref 35507); Thu, 02 May 2019 16:11:01 +0000 Original-Received: (at 35507) by debbugs.gnu.org; 2 May 2019 16:10:52 +0000 Original-Received: from localhost ([127.0.0.1]:46817 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hMEIN-0007YI-L2 for submit@debbugs.gnu.org; Thu, 02 May 2019 12:10:51 -0400 Original-Received: from mail-ed1-f67.google.com ([209.85.208.67]:34700) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hMEIL-0007Y5-0n for 35507@debbugs.gnu.org; Thu, 02 May 2019 12:10:49 -0400 Original-Received: by mail-ed1-f67.google.com with SMTP id w35so954083edd.1 for <35507@debbugs.gnu.org>; Thu, 02 May 2019 09:10:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=W1qyBb5kz6WdhmyMBC0d6y2u0wpYmecrwuUBHK8ZpXs=; b=EKJpWId3GRZo7NUjfDfv6G14iWXtE2uCOIjvRfJmzRQ7bWlFb7gTFedOWk5tSoC6PA hoejMBb/2gHpPywcXyNW9ERUHytr/oy+LpqHGiRPgX7xonEaYRcrLt0dsL2ue1KlqkQQ cPIM/M+u+fjkp6gvuJvABUeIXSOOnCg/4tBvuf6ietWnY5LC6BSITHm2wixtS7Sp5QEm KHklH0YQvKtLyF/PL0HLd8RdwyC+G3jCirdukeTsbaz8iJvMFh6ZCy2+31NUQKJ2JxCq OMMCHYY3RXJUT+Z36nRRx4QT0uwf5RLap/PtFcwZhhOuBMdTnLnTYF2jIrMln3BWvlNr TT9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=W1qyBb5kz6WdhmyMBC0d6y2u0wpYmecrwuUBHK8ZpXs=; b=BSyt+7uBeiQ9iDVjiCjizAlx1mMGYWmuSIGVBs4aGk76+eZ+76mOmQG2AmHsuIL84j T1Lb9N4GyCZkfgSPJhDuZ1NHZF7QxE4lKU3qCdb9Ceh0AzrOLZPZpRes6TiJwpFm1jzv gfMIrXk5nem38TwFazg9cJZ/i+eIc2hzy+qvHjde0R/V0M6iVpKGeQRAeusH/ohl2oH0 LorVeYH52ZKZRz/YaUrQX5SZ9dxRtp8DwhFgs8oJlqir9ZKbyW5UeJ+bFo2ha7b/Nfhg dtXMgM1TXETb+xFh7cff+dr+DCJ4FaV2VDY32vndXz5k75JZeaBhi0k6vTKWHDn7R5qU U8pA== X-Gm-Message-State: APjAAAW5ZI2AE7bHx2yP9HZ7kWwsR8a8Z6DDu47yzZnGTFjvN6139m5z cNylaGfrMPNlvcwnfJmcmLhQvg== X-Google-Smtp-Source: APXvYqzODN40/kxZoax5aMcG3U6AzkcPlti6IZEDOnXVRerSpnXvcnpsTodW71etxkoejTBdGgyYxQ== X-Received: by 2002:a50:e442:: with SMTP id e2mr2991521edm.227.1556813443168; Thu, 02 May 2019 09:10:43 -0700 (PDT) Original-Received: from localhost ([2a02:8084:20e2:c380:8cad:ae29:555d:852d]) by smtp.gmail.com with ESMTPSA id d6sm11818483edq.65.2019.05.02.09.10.41 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 02 May 2019 09:10:42 -0700 (PDT) In-Reply-To: <83ftpwq270.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 2 May 2019 18:57:23 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:158646 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Andy Moreton >> Date: Thu, 02 May 2019 16:43:31 +0100 >> >> > So yes, I think Noam is right, and 'undecided' is a better alternative here. >> >> That is arguing for the existing code, which does not work correctly. > > No, the existing code simply uses the undecoded string. > > What I argue for is to do this: > > diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el > index 1e1d264b99..173ebfab48 100644 > --- a/lisp/gnus/mm-view.el > +++ b/lisp/gnus/mm-view.el > @@ -475,7 +475,7 @@ mm-display-inline-fontify > (charset > (mm-decode-string text charset)) > (t > - text))) > + (mm-decode-string text 'undecided)))) > (let ((font-lock-verbose nil) ; font-lock is a bit too verbose. > (enable-local-variables nil)) > ;; We used to set font-lock-mode-hook to nil to avoid enabling > >> I am disinclined to look any further at this, as nobody else appears to >> be running the existing code before commenting, or testing the proposed >> patch. > > Please don't be offended, there's no intent to offend you here. Your > efforts are greatly appreciated. We are just discussing a small > change to what you were proposing, see above. > > Or are you saying that using undecided as above doesn't do the job? > > (Sorry, I don't use Gnus, so to be able to reproduce the problem and > test a proposed solution I need detailed instructions, I cannot easily > do it myself without investing an inordinate amount of time.) FWIW, I use Gnus, and your suggested change to mm-display-inline-fontify fixes the inline display of the patch in the OP for me. BTW, the last two cond branches can be merged following your change: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=mm-view.diff diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el index 1e1d264b99..849488293a 100644 --- a/lisp/gnus/mm-view.el +++ b/lisp/gnus/mm-view.el @@ -472,10 +472,8 @@ mm-display-inline-fontify (buffer-string))) (coding-system (decode-coding-string text coding-system)) - (charset - (mm-decode-string text charset)) - (t - text))) + (t + (mm-decode-string text (or charset 'undecided))))) (let ((font-lock-verbose nil) ; font-lock is a bit too verbose. (enable-local-variables nil)) ;; We used to set font-lock-mode-hook to nil to avoid enabling --=-=-= Content-Type: text/plain Thanks, -- Basil --=-=-=--