Subject: Re: bug#57531: 28.1; Character encoding missing for "eo"

From: Eli Zaretskii <[email-masked]>
Date: Fri, 02 Sep 2022 08:52:29 +0300

> Date: Thu, 01 Sep 2022 18:47:10 +0000
> From: Jonathan Reeve <[email-masked]>
> 
> 
> When my language and locale are set to "eo," (Esperanto), the character
> encoding in Emacs is the wrong character encoding. It should be UTF-8,
> but instead it's something else.

Thank you for your report.

Can you tell what is the default encoding in that case?

> I think the problem is in the =locale-language-names= variable,
> which has these lines:
> 
>     ("en_IN" "English" utf-8) ; glibc uses utf-8 for English in India
>     ("en" "English" iso-8859-1) ; English
>     ("eo" . "Esperanto") ; Esperanto
>     ("es" "Spanish" iso-8859-1)
> 
> The line ("eo" . "Esperanto") should probably instead be ("eo"
> "Esperanto" utf-8).

If you want the UTF-8 encoding to be the default, why is your locale
set to "eo" and not to "eo.UTF-8"?

In general, Emacs prefers taking the locale's codeset from your
system's definitions, to avoid overriding the user's system setup.  It
only applies default encoding when the locale doesn't specify the
codeset, or when a locale can support only a single codeset.

> To test this, set your LANG variable to "eo" and then notice that the
> character encooding (locale-coding-system) is not utf-8, as it should be.

Are you saying that the Esperanto locale _must_ use UTF-8?  If so,
why?  AFAIK, ISO-8859-3 covers the Esperanto characters, so UTF-8 is
not the only possible codeset for Esperanto locales.