all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: 35507@debbugs.gnu.org, andrewjmoreton@gmail.com
Subject: bug#35507: Gnus mojibakifies UTF-8 text/x-patch attachments from	Thunderbird
Date: Thu, 02 May 2019 14:04:26 +0300	[thread overview]
Message-ID: <2133CEDA-748F-44F0-901B-D7213645369A@gnu.org> (raw)
In-Reply-To: <86v9ytz5nk.fsf@gmail.com>

On May 2, 2019 10:17:51 AM GMT+03:00, Andy Moreton <andrewjmoreton@gmail.com> wrote:
> On Wed 01 May 2019, Noam Postavsky wrote:
> 
> > Eli Zaretskii <eliz@gnu.org> writes:
> >
> >>> From: Andy Moreton <andrewjmoreton@gmail.com>
> >>> 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

Using 'undecided' doesn't disable decoding, it just means Emacs will try to detect the correct encoding by looking at the text (not at the charset header).  In a UTF-8 locale, we will guess UTF-8 anyway, unless we see invalid sequences.

So yes, I think Noam is right, and 'undecided' is a better alternative here.





  reply	other threads:[~2019-05-02 11:04 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-30 19:20 bug#35507: Gnus mojibakifies UTF-8 text/x-patch attachments from Thunderbird Paul Eggert
2019-05-01  0:35 ` Andy Moreton
2019-05-01 15:22   ` Robert Pluim
2019-05-01 15:45     ` Andy Moreton
2019-05-01 16:42       ` Andy Moreton
2019-05-01 17:36         ` Eli Zaretskii
2019-05-01 23:54           ` Andy Moreton
2019-05-02  3:07           ` Noam Postavsky
2019-05-02  7:17             ` Andy Moreton
2019-05-02 11:04               ` Eli Zaretskii [this message]
2019-05-02 15:43                 ` Andy Moreton
2019-05-02 15:57                   ` Eli Zaretskii
2019-05-02 16:08                     ` Andy Moreton
2019-05-02 16:50                       ` Eli Zaretskii
2019-05-02 17:13                       ` Eric Abrahamsen
2019-05-02 17:45                         ` Andy Moreton
2019-05-02 16:10                     ` Basil L. Contovounesios
2019-05-02 16:50                       ` Eli Zaretskii
2019-05-02 17:20                         ` Eli Zaretskii
2019-05-03 13:55                           ` Basil L. Contovounesios
2019-05-02 16:29                     ` Robert Pluim
2019-05-02 16:53                       ` Eli Zaretskii
2019-05-02 12:01               ` Noam Postavsky
2019-05-02 15:40                 ` Eli Zaretskii
2019-05-03 14:02                   ` Basil L. Contovounesios
2019-05-03 15:14                     ` Eli Zaretskii
2019-05-03 15:20                       ` Basil L. Contovounesios
2019-05-01 17:34     ` Eli Zaretskii
2019-05-02  6:35       ` Robert Pluim
2019-05-01 17:33   ` Eli Zaretskii
2019-05-01 17:32 ` Eli Zaretskii
2019-05-01 18:26   ` Paul Eggert
2019-05-01 19:05     ` Eli Zaretskii
2019-05-01 19:47       ` Andreas Schwab
2019-05-01 19:57         ` Eli Zaretskii
2019-05-02 23:24 ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2133CEDA-748F-44F0-901B-D7213645369A@gnu.org \
    --to=eliz@gnu.org \
    --cc=35507@debbugs.gnu.org \
    --cc=andrewjmoreton@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.