GNU bug report logs - #57531
28.1; Character encoding missing for "eo"

Previous Next

Package: emacs;

Reported by: Jonathan Reeve <jonathan <at> jonreeve.com>

Date: Thu, 1 Sep 2022 19:34:02 UTC

Severity: normal

Tags: moreinfo

Found in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: jonathan <at> jonreeve.com
Cc: 57531 <at> debbugs.gnu.org, schwab <at> linux-m68k.org
Subject: bug#57531: 28.1; Character encoding missing for "eo"
Date: Sun, 04 Sep 2022 11:28:06 +0300
> Cc: jonathan <at> jonreeve.com, 57531 <at> debbugs.gnu.org
> Date: Sun, 04 Sep 2022 10:46:29 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> But like I said: feel free to submit a patch that doesn't potentially
> destroy everything we have in that setup.  If the patch is safe
> enough, I see no reason not to accept it.

Something like the below could be acceptable, if it solves the
problem.

diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 4137642..6866291 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -2317,7 +2317,7 @@ locale-language-names
     ;; en_IN -- fx.
     ("en_IN" "English" utf-8) ; glibc uses utf-8 for English in India
     ("en" "English" iso-8859-1) ; English
-    ("eo" . "Esperanto") ; Esperanto
+    ("eo" "Esperanto" locale-info) ; Esperanto
     ("es" "Spanish" iso-8859-1)
     ("et" . "Latin-9") ; Estonian
     ("eu" . "Latin-1") ; Basque
@@ -2522,8 +2522,12 @@ locale-language-names
   (LOCALE-REGEXP LANG-ENV CODING-SYSTEM)
 The first element whose LOCALE-REGEXP matches the start of a
 downcased locale specifies the LANG-ENV \(language environment)
-and CODING-SYSTEM corresponding to that locale.  If there is no
-appropriate language environment, the element may have this form:
+and CODING-SYSTEM corresponding to that locale.
+CODING-SYSTEM can be the special symbol `locale-info', which
+means we should call `locale-info' to request the codeset of
+the current locale.
+If there is no appropriate language environment, the element may
+have this form:
   (LOCALE-REGEXP . LANG-ENV)
 In this case, LANG-ENV is one of generic language environments for an
 specific encoding such as \"Latin-1\" and \"UTF-8\".")
@@ -2794,9 +2798,23 @@ set-locale-environment
 	    ;; locale-language-names specify both lang-env and coding.
 	    ;; But, what specified in locale-preferred-coding-systems
 	    ;; has higher priority.
-	    (setq coding-system (or coding-system
-				    (nth 1 language-name))
-		  language-name (car language-name))
+            (progn
+	      (setq coding-system (or coding-system
+				      (nth 1 language-name))
+		    language-name (car language-name))
+              ;; If locale-language-names specifies we should query
+              ;; the underlying libc, do that now, but only when we
+              ;; are setting up for the current locale, i.e. when this
+              ;; function is called from startup.el with an argument
+              ;; of nil.
+              (if (eq coding-system 'locale-info)
+                  (if locale-name
+                      (setq coding-system nil)
+                    (let ((locale-codeset (locale-info 'codeset)))
+                      (when (stringp locale-codeset)
+                        (setq coding-system (intern (downcase locale-codeset)))
+                        (unless (coding-system-p coding-system)
+                          (setq coding-system nil)))))))
 	  ;; Otherwise, if locale is not listed in locale-language-names,
 	  ;; use what listed in locale-charset-language-names.
 	  (if (not language-name)




This bug report was last modified 2 years and 228 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.