bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#43351: 27.1; [PATCH] Change ASCII handling in mm-charset-to-coding-s


From: Lars Ingebrigtsen
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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]