unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Alex Bochannek <alex@bochannek.com>
Cc: 43351@debbugs.gnu.org
Subject: bug#43351: 27.1; [PATCH] Change ASCII handling in mm-charset-to-coding-system to us-ascii
Date: Sat, 12 Sep 2020 16:13:43 +0200	[thread overview]
Message-ID: <87pn6r13s8.fsf@gnus.org> (raw)
In-Reply-To: <m2lfhfcw7k.fsf@bochannek.com> (Alex Bochannek's message of "Sat,  12 Sep 2020 00:04:15 -0700")

Alex Bochannek <alex@bochannek.com> writes:

> This is a very small patch, but I am not confident that there aren't
> other side effects, so please evaluate it carefully.

The patch makes sense conceptually, but it can't be applied because
there's code (presumably) all over the place that depends on it
returning `ascii'.  For instance:

  (let ((cs (mm-charset-to-coding-system charset nil allow-override)))
    (cond ((eq cs 'ascii)
	   (setq cs (or (mm-charset-to-coding-system mail-parse-charset)
			'raw-text)))

> In the fix for bug#5458 (2011-06-30), a change was made to
> mm-charset-to-coding-system to support "ansi.x3.4*" as an alias for
> 'ascii. As part of that patch 'us-ascii was also mapped to 'ascii. This
> is problematic because decode-coding-string does not recognize 'ascii as
> a coding system and throws an "Invalid coding system: ascii" exception.

Indeed; ascii isn't a valid coding system...  but poking around here, I
think the function (despite its name) isn't really returning a coding
system.  I mean, it does in most cases, but not for ascii.  :-/

(The doc string of the function should be fixed.)

> As a result, when using gnus-article-browse-html-article (K H) to
> display a text/html message that has charset=us-ascii (or presumably
> also charset=ascii), the display will fail iff the header of the message
> is not ASCII.

I think this has to be changed in gnus-article-browse-html-article
instead, unfortunately.  

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2020-09-12 14:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-12  7:04 bug#43351: 27.1; [PATCH] Change ASCII handling in mm-charset-to-coding-system to us-ascii Alex Bochannek
2020-09-12 14:13 ` Lars Ingebrigtsen [this message]
2020-09-12 14:19   ` Eli Zaretskii
2020-09-13  1:00     ` Alex Bochannek
2020-09-13 12:40       ` Lars Ingebrigtsen
2020-09-13 12:39     ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87pn6r13s8.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=43351@debbugs.gnu.org \
    --cc=alex@bochannek.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).