From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.bugs Subject: bug#35507: Gnus mojibakifies UTF-8 text/x-patch attachments from Thunderbird Date: Wed, 01 May 2019 17:42:18 +0100 Message-ID: References: <44a26585-7980-378c-9262-a567ddd3e617@cs.ucla.edu> <865zqv3tc2.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="223658"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt) To: 35507@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 01 18:43:14 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 1hLsKA-000w4q-8s for geb-bug-gnu-emacs@m.gmane.org; Wed, 01 May 2019 18:43:14 +0200 Original-Received: from localhost ([127.0.0.1]:36617 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLsK9-00072m-9g for geb-bug-gnu-emacs@m.gmane.org; Wed, 01 May 2019 12:43:13 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55357) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLsK1-00072g-DJ for bug-gnu-emacs@gnu.org; Wed, 01 May 2019 12:43:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hLsJy-0008VQ-Bf for bug-gnu-emacs@gnu.org; Wed, 01 May 2019 12:43:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59423) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hLsJy-0008V5-8a for bug-gnu-emacs@gnu.org; Wed, 01 May 2019 12:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hLsJy-0007Xc-2f; Wed, 01 May 2019 12:43:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <44a26585-7980-378c-9262-a567ddd3e617@cs.ucla.edu> Resent-From: Andy Moreton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Wed, 01 May 2019 16:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35507 X-GNU-PR-Package: emacs,gnus X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.155672895928959 (code B ref -1); Wed, 01 May 2019 16:43:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 May 2019 16:42:39 +0000 Original-Received: from localhost ([127.0.0.1]:44734 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hLsJa-0007X1-Nq for submit@debbugs.gnu.org; Wed, 01 May 2019 12:42:38 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:40812) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hLsJZ-0007Wo-AI for submit@debbugs.gnu.org; Wed, 01 May 2019 12:42:37 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:42324) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hLsJU-00063f-5M for submit@debbugs.gnu.org; Wed, 01 May 2019 12:42:32 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55181) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLsJQ-0006yn-Vr for bug-gnu-emacs@gnu.org; Wed, 01 May 2019 12:42:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hLsJN-0005Yh-Tc for bug-gnu-emacs@gnu.org; Wed, 01 May 2019 12:42:28 -0400 Original-Received: from [195.159.176.226] (port=40798 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hLsJN-0005TZ-LQ for bug-gnu-emacs@gnu.org; Wed, 01 May 2019 12:42:25 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1hLsJL-000uru-S0 for bug-gnu-emacs@gnu.org; Wed, 01 May 2019 18:42:23 +0200 X-Injected-Via-Gmane: http://gmane.org/ Cancel-Lock: sha1:V9IrbD9FaFr3emprsOOroYcVbKc= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:158581 Archived-At: On Wed 01 May 2019, Andy Moreton wrote: > On Wed 01 May 2019, Robert Pluim wrote: > >>>>>>> On Wed, 01 May 2019 01:35:09 +0100, Andy Moreton said: >> Andy> After a bit of experimenting, this minimal patch appears to >> Andy> fix things. Should this also allow the user to choose the >> Andy> charset if none is specified, or just hardwire it to utf-8 ? >> >> I think utf-8 is a good fallback if the message doesnʼt specify a >> charset. Itʼs not going to produce any worse effects than what we have >> now. > > Looking at this a bit more, the " *mm*" temp buffers produced when > decoding the MIME parts all seems to have the right coding, so my > previous patch looks wrong. > > The problem may be in `mm-display-inline-fontify' when it tries to > choose a charset or coding system to display the MIME part inline. This patch only affects display, so should be safer: 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 'utf-8)))) (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