From: Alex Bochannek <alex@bochannek.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Lars Ingebrigtsen <larsi@gnus.org>, 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 18:00:42 -0700 [thread overview]
Message-ID: <m2imciebid.fsf@bochannek.com> (raw)
In-Reply-To: <m2lfhfcw7k.fsf@bochannek.com>
[-- Attachment #1: Type: text/plain, Size: 1055 bytes --]
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?
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Add 'ascii as alias for 'us-ascii coding system --]
[-- Type: text/x-patch, Size: 425 bytes --]
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)."
[-- Attachment #3: Type: text/plain, Size: 44 bytes --]
Thanks!
--
Alex. <abochannek@google.com>
next prev parent reply other threads:[~2020-09-13 1:00 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
2020-09-12 14:19 ` Eli Zaretskii
2020-09-13 1:00 ` Alex Bochannek [this message]
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=m2imciebid.fsf@bochannek.com \
--to=alex@bochannek.com \
--cc=43351@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=larsi@gnus.org \
/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).