From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#35507: Gnus mojibakifies UTF-8 text/x-patch attachments from Thunderbird Date: Thu, 02 May 2019 14:04:26 +0300 Message-ID: <2133CEDA-748F-44F0-901B-D7213645369A@gnu.org> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="4708"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: K-9 Mail for Android To: 35507@debbugs.gnu.org, andrewjmoreton@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu May 02 13:05:18 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 1hM9Wf-00014E-Rk for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 May 2019 13:05:17 +0200 Original-Received: from localhost ([127.0.0.1]:49204 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hM9We-00008g-Mu for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 May 2019 07:05:16 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:51650) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hM9WU-00006K-FR for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 07:05:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hM9WS-0006st-He for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 07:05:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60355) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hM9WQ-0006pV-Ps for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 07:05:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hM9WQ-0004JX-Hi; Thu, 02 May 2019 07:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Thu, 02 May 2019 11:05: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, Andy Moreton , 35507@debbugs.gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.155679508016552 (code B ref -1); Thu, 02 May 2019 11:05:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 May 2019 11:04:40 +0000 Original-Received: from localhost ([127.0.0.1]:45665 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hM9W3-0004It-Tr for submit@debbugs.gnu.org; Thu, 02 May 2019 07:04:40 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:37111) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hM9W2-0004IV-El for submit@debbugs.gnu.org; Thu, 02 May 2019 07:04:38 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:53950) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hM9Vv-0006V4-Lw for submit@debbugs.gnu.org; Thu, 02 May 2019 07:04:33 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:51486) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hM9Vu-0008Ux-J5 for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 07:04:31 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:40757) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hM9Vu-0006U5-FG; Thu, 02 May 2019 07:04:30 -0400 Original-Received: from [176.12.229.109] (port=37690 helo=[10.208.206.146]) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1hM9Vs-0006b0-VW; Thu, 02 May 2019 07:04:29 -0400 In-Reply-To: <86v9ytz5nk.fsf@gmail.com> 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:158625 Archived-At: On May 2, 2019 10:17:51 AM GMT+03:00, Andy Moreton wrote: > On Wed 01 May 2019, Noam Postavsky wrote: >=20 > > Eli Zaretskii writes: > > > >>> From: Andy Moreton > >>> Date: Wed, 01 May 2019 17:42:18 +0100 > >>>=20 > >>> + (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=3DUTF-8" header)=2E If > passing > > 'utf-8, then it's just the same as calling decode-coding-string=2E >=20 > OK, in that case we could indeed just call decode-coding-string=2E >=20 > > 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=2E >=20 > 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=2E >=20 > 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=2E >=20 > That should result in text that actually is UTF-8 being displayed > correctly, and no change to plain ASCII=2E For anything else, the user > can > use the `gnus-mime-view-part-as-charset' command to override the > default=2E >=20 > AndyM Using 'undecided' doesn't disable decoding, it just means Emacs will try t= o detect the correct encoding by looking at the text (not at the charset he= ader)=2E In a UTF-8 locale, we will guess UTF-8 anyway, unless we see inva= lid sequences=2E So yes, I think Noam is right, and 'undecided' is a better alternative her= e=2E