From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alexandre Duret-Lutz Newsgroups: gmane.emacs.bugs Subject: bug#44307: 27.1; UTF-8 parts transferred as 8bit in multipart messages fail to decode Date: Sun, 10 Jan 2021 15:48:35 +0100 Message-ID: <87turoyhj0.fsf@lrde.epita.fr> References: <8735zj6q6h.fsf@goulash.lrde.epita.fr> <8735zf3f46.fsf@gnus.org> <87k0srg0hz.fsf@goulash.lrde.epita.fr> <87wnwo3kd2.fsf@gnus.org> <87wnwo7muj.fsf@lrde.epita.fr> <87wnwlugd0.fsf@gnus.org> <874kjoc2ks.fsf@lrde.epita.fr> <874kjoubjy.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2995"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 44307@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 10 15:49:28 2021 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 1kyc23-0000ft-Ar for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 10 Jan 2021 15:49:27 +0100 Original-Received: from localhost ([::1]:45364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kyc20-0006A9-QJ for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 10 Jan 2021 09:49:24 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyc1e-0006A3-7V for bug-gnu-emacs@gnu.org; Sun, 10 Jan 2021 09:49:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42041) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kyc1e-00085q-0f for bug-gnu-emacs@gnu.org; Sun, 10 Jan 2021 09:49:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kyc1d-0005h0-VH; Sun, 10 Jan 2021 09:49:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alexandre Duret-Lutz Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Sun, 10 Jan 2021 14:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44307 X-GNU-PR-Package: emacs,gnus Original-Received: via spool by 44307-submit@debbugs.gnu.org id=B44307.161029012621849 (code B ref 44307); Sun, 10 Jan 2021 14:49:01 +0000 Original-Received: (at 44307) by debbugs.gnu.org; 10 Jan 2021 14:48:46 +0000 Original-Received: from localhost ([127.0.0.1]:53586 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyc1N-0005gL-L4 for submit@debbugs.gnu.org; Sun, 10 Jan 2021 09:48:45 -0500 Original-Received: from mail-wr1-f46.google.com ([209.85.221.46]:40070) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyc1L-0005fy-8g for 44307@debbugs.gnu.org; Sun, 10 Jan 2021 09:48:44 -0500 Original-Received: by mail-wr1-f46.google.com with SMTP id 91so13763262wrj.7 for <44307@debbugs.gnu.org>; Sun, 10 Jan 2021 06:48:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=rsn+lpw9msKYeqt4Xy3ceTslNe6cgFBzTtDWMull6SQ=; b=fnOlGEqonQwyManjcnoi3i2ioapJxzXOz4m6fVjUV6f2WS1jAnZUB5kC0SaX++XvQM ukOb+KC6MafkniAcfNvG0NFgFmNI2RitiaQarGqiN0oFn56NsMZ9oFID8J/NuqkYAlS4 ylVKkXs+UX7DgT0oZmvQTzJn7J5zP5iV9iYAaIAkysI8Y+znhneuuQqeEBVE3cQSdkUS uI4gG0//QyQyNCDRtooK2Z4ii/xklct4F3GVytX0x/7F3uvljTlRPnXCs1KGqLt2Vwom pdPglnVs4IksugSPI06qhGG1412Db/cgYDZyw0RllSU8d65smRs2UMsPHq7AY9w2jtz+ Qkxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=rsn+lpw9msKYeqt4Xy3ceTslNe6cgFBzTtDWMull6SQ=; b=TeNgRn0FNavYxL98BMVwyraEntLSLErMbG0z/Wadn3/I7DBg4RMfQLPXFqyO62hysg Ln7TJv103XY3hHgdMm1xa59wbXIvkj1Ovg107482qV0V3mcGzJIH+fqrmospIgXSer8t 6yLaBfuSKGvYZs6uyutZr8kpg97xA0fuUKpIOlR3wtS1pbZJ7J2zRsnuwFM/+X5hs8K5 lMf0lm2qrQ2higKPF0tSsYuVi9UxvQRttnaTBl1I8kRkrtutDjlTkDCTqgus0sLX/TK2 t4yffwzP30mKXt0SdPTWR9iHRFClhg/5xNgejuaF1qtupIUc1NcZAujEifoUCuma1pwT PcYA== X-Gm-Message-State: AOAM533YSYmJB7FRobEoOGj1UsbUNSpsHXmi8t3sdkEF+66sFLpoe8+M xuSTlRbh5YBsDT0yymUo8FbW8RNpPvQlsA== X-Google-Smtp-Source: ABdhPJy/SLRJ991thYeG/re644HW9QTlirpbfv2IVJH9tMeLvFzq0jOUrhYwA3OYgv4QCTvD5E4c6Q== X-Received: by 2002:adf:b194:: with SMTP id q20mr12515194wra.199.1610290117512; Sun, 10 Jan 2021 06:48:37 -0800 (PST) Original-Received: from goulash (89-109-190-109.dsl.ovh.fr. [109.190.109.89]) by smtp.gmail.com with ESMTPSA id p9sm18912141wmm.17.2021.01.10.06.48.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Jan 2021 06:48:36 -0800 (PST) In-Reply-To: <874kjoubjy.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 10 Jan 2021 15:11:13 +0100") 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:197620 Archived-At: Lars Ingebrigtsen writes: > Alexandre Duret-Lutz writes: > >> Without (mm-disable-multibyte), the patch makes no difference to me. > > Darn. The multibyteness here isn't what you should be looking at, > though -- the " *nntpd*" buffer is multibyte, so it's all gonna end up > in that state, anyway. We just have to trick Emacs into not > interpreting the files as text, but as bytes, which is what nnml's > request-article function does, for instance. The following patch seems to fix my rendering issues. I don't understand why nnheader-insert-file-contents with 'raw-text coding does not seem to work as desired on a multibyte-buffer. I'll try to play with it more. This patch has the potential side effect of leaving to-buffer as multibyte even if it was initially unibyte. I don't know if this could be an issue. You seem to suggest those buffer are meant to be multibyte anyway. You've mentioned the " *nntpd*" buffer, but in make case this code seems to be always using to-buffer ("*Article nnmaildir+gmail:Inbox*"). Not sure if this matters. diff --git a/lisp/gnus/nnmaildir.el b/lisp/gnus/nnmaildir.el index e4fd976742..ca2b0e1295 100644 --- a/lisp/gnus/nnmaildir.el +++ b/lisp/gnus/nnmaildir.el @@ -1351,7 +1351,10 @@ nnmaildir-request-article (throw 'return nil)) (with-current-buffer (or to-buffer nntp-server-buffer) (erase-buffer) - (nnheader-insert-file-contents nnmaildir-article-file-name)) + (mm-disable-multibyte) + (let ((coding-system-for-read mm-text-coding-system)) + (nnheader-insert-file-contents nnmaildir-article-file-name)) + (mm-enable-multibyte)) (cons gname num-msgid)))) (defun nnmaildir-request-post (&optional _server) -- Alexandre Duret-Lutz