Subject: bug#35383: 27.0.50; Complete process of decoding Gnus group names

From: Eli Zaretskii <[email-masked]>
Date: Tue, 30 Apr 2019 06:55:00 +0300

> From: Eric Abrahamsen <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Mon, 29 Apr 2019 13:04:31 -0700
> 
> >> Actually, maybe that's wrong. We don't care how the files are written,
> >> only that, after parsing, the group names are successfully _decoded_ to
> >> 'utf-8-emacs. Maybe I'm trying too hard?
> >
> > When you decode _any_ text by _any_ coding-system, the result is
> > _always_ utf-8-emacs, because utf-8-emacs is the internal
> > representation of characters and raw bytes in Emacs buffers and
> > strings.
> 
> I did know that much! I'm pretty bad at encoding, but not quite that
> bad.

Sorry, it was not clear to me, since you talked about "decoding to
utf-8-emacs", which is a kind of tautology.

> So you think Gnus' various *-file-coding-system options should
> default to 'utf-8-emacs rather than 'raw-text?

Not sure about all of them, I don't think I have a clear idea of what
they are used for.  The principle is that we use utf-8-emacs for files
where Emacs records its internal data, and whose primary role is to
allow Emacs to restore its internal data with maximum reliability.
One good example of this is auto-save files, where we use utf-8-emacs
regardless of the actual encoding of the file whose buffer is
auto-saved.

If this principle is not enough to make a decision, please point out
the specific variables you are unsure about, and I will take a look at
their actual usage.

> As per your other message, it sounds like active files written as
> 'raw-text will probably survive being read as 'utf-8-emacs. And if the
> user has previously customized those options to something else, the
> change in default value won't matter anyway.

That is true, but good defaults do matter to new users and new files.

And raw-text is almost never appropriate as the default for
human-readable text.

> What I meant by "trying too hard" is, maybe it's enough to just change
> the defaults, and not add any other error checking and guarantees?

What other checks and guarantees did you consider?  (Sorry, I didn't
read the entire thread, so maybe just point me to the message where
you described this.)