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: Alex Bochannek
Subject: bug#43351: 27.1; [PATCH] Change ASCII handling in mm-charset-to-coding-system to us-ascii
Date: Sat, 12 Sep 2020 18:00:42 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (darwin)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Lars Ingebrigtsen <larsi@gnus.org>
>> Date: Sat, 12 Sep 2020 16:13:43 +0200
>> Cc: 43351@debbugs.gnu.org
>> 
>> > 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.  :-/
>
> Maybe the simplest solution is to define a coding-system-alias named
> 'ascii'.

I like this approach because it seems like it would do the least amount
of potential harm. I am happy to just put a (define-coding-system-alias
'ascii 'us-ascii) in my .gnus, but should this possibly be done in
mule-conf.el?

diff --git a/lisp/international/mule-conf.el b/lisp/international/mule-conf.el
index edda79ba4e..c84f0a4990 100644
--- a/lisp/international/mule-conf.el
+++ b/lisp/international/mule-conf.el
@@ -1508,6 +1508,7 @@ 'us-ascii
   :mime-charset 'us-ascii)
 
 (define-coding-system-alias 'iso-safe 'us-ascii)
+(define-coding-system-alias 'ascii 'us-ascii)
 
 (define-coding-system 'utf-7
   "UTF-7 encoding of Unicode (RFC 2152)."
Thanks!

-- 
Alex. <abochannek@google.com>

reply via email to

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