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: Thu, 02 May 2019 08:17:51 +0100 Message-ID: <86v9ytz5nk.fsf@gmail.com> References: <44a26585-7980-378c-9262-a567ddd3e617@cs.ucla.edu> <865zqv3tc2.fsf@gmail.com> <838svqqdp2.fsf@gnu.org> <87d0l1o8p7.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="263890"; 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 Thu May 02 09:19:30 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 1hM60A-0016VE-Mk for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 May 2019 09:19:30 +0200 Original-Received: from localhost ([127.0.0.1]:46412 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hM609-0001JY-Kh for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 May 2019 03:19:29 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57564) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hM603-0001JP-Sr for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 03:19:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hM600-0007o5-3h for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 03:19:23 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60178) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hM5zi-0007LE-GA for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 03:19:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hM5zi-0007My-8h; Thu, 02 May 2019 03:19: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: Thu, 02 May 2019 07:19: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.155678152428304 (code B ref -1); Thu, 02 May 2019 07:19:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 May 2019 07:18:44 +0000 Original-Received: from localhost ([127.0.0.1]:45489 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hM5zQ-0007MS-E9 for submit@debbugs.gnu.org; Thu, 02 May 2019 03:18:44 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43058) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hM5zO-0007ME-DL for submit@debbugs.gnu.org; Thu, 02 May 2019 03:18:42 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:34721) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hM5zC-0006bP-VL for submit@debbugs.gnu.org; Thu, 02 May 2019 03:18:33 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57419) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hM5zB-0001G2-UT for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 03:18:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hM5z4-0006SN-1H for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 03:18:24 -0400 Original-Received: from [195.159.176.226] (port=49750 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hM5z3-0005rm-2k for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 03:18:21 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1hM5yg-0014HN-T0 for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 09:17:58 +0200 X-Injected-Via-Gmane: http://gmane.org/ Cancel-Lock: sha1:35U4ff8HqTybX6sZdAJgdJxQOzI= 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:158619 Archived-At: On Wed 01 May 2019, Noam Postavsky wrote: > Eli Zaretskii writes: > >>> From: Andy Moreton >>> Date: Wed, 01 May 2019 17:42:18 +0100 >>> >>> + (mm-decode-string text 'utf-8)))) >> >> As I said, I'm not sure we should do this, let alone unconditionally >> force UTF-8 here, but if we must, why not use decode-coding-string? >> Do we really need the mm-* stuff? > > As far as I can tell, the mm-* version is useful for handling stuff lke > "UTF-8" as the charset argument (which might be useful if we extract it > from the "Content-Type: text/plain; charset=UTF-8" header). If passing > 'utf-8, then it's just the same as calling decode-coding-string. OK, in that case we could indeed just call decode-coding-string. > For a default if we don't find a charset header, I guess `undecided' > would make more sense, right? After all, Emacs already has the coding > detection machinery, may as well use it. Please re-read the original bug report: the problem is with malformed messages that do not contain a charset field in the Content-Type header. The one-liner patch changes the default for inline display in the Gnus article buffer to assume UTF-8 when nothing is specified, rather than just inserting the text without decoding it. That should result in text that actually is UTF-8 being displayed correctly, and no change to plain ASCII. For anything else, the user can use the `gnus-mime-view-part-as-charset' command to override the default. AndyM