]> git.eshelyaron.com Git - emacs.git/commitdiff
* w32-fns.el (w32-list-locales): Decode output of `w32-get-locale-info'
authorJuanma Barranquero <lekktu@gmail.com>
Fri, 17 Oct 2008 11:11:34 +0000 (11:11 +0000)
committerJuanma Barranquero <lekktu@gmail.com>
Fri, 17 Oct 2008 11:11:34 +0000 (11:11 +0000)
  according to `locale-coding-system'.  (This fixes trivial bug reported
  as part of bug#1179).
  Sort list of valid locale ids (EnumSystemLocales does not guarantee any
  particular order).  Use `when'.

lisp/ChangeLog
lisp/w32-fns.el

index f3e6fe7c2a9639a4c2f6459b220e689e49403e4e..0ee9b6196c9dfeeefde083612bd9018feef3929a 100644 (file)
@@ -1,3 +1,11 @@
+2008-10-17  Juanma Barranquero  <lekktu@gmail.com>
+
+       * w32-fns.el (w32-list-locales): Decode output of `w32-get-locale-info'
+       according to `locale-coding-system'.  (This fixes trivial bug reported
+       as part of bug#1179).
+       Sort list of valid locale ids (EnumSystemLocales does not guarantee any
+       particular order).  Use `when'.
+
 2008-10-16  Juanma Barranquero  <lekktu@gmail.com>
 
        * w32-fns.el (w32-check-shell-configuration): Doc fix.
index 8a8ef7f1739797588d9f5955f061e53012b81acd..70057871c31768f2fe6405191068a1077967fae0 100644 (file)
@@ -217,18 +217,19 @@ You should set this to t when using a non-system shell.\n\n"))))
 (defun w32-list-locales ()
   "List the name and id of all locales supported by Windows."
   (interactive)
-  (if (null w32-valid-locales)
-      (setq w32-valid-locales (w32-get-valid-locale-ids)))
+  (when (null w32-valid-locales)
+    (setq w32-valid-locales (sort (w32-get-valid-locale-ids) #'<)))
   (switch-to-buffer-other-window (get-buffer-create "*Supported Locales*"))
   (erase-buffer)
   (insert "LCID\tAbbrev\tFull name\n\n")
-  (insert (mapconcat
-          '(lambda (x)
-             (format "%d\t%s\t%s"
-                     x
-                     (w32-get-locale-info x)
-                     (w32-get-locale-info x t)))
-          w32-valid-locales "\n"))
+  (insert (decode-coding-string (mapconcat
+                                (lambda (x)
+                                  (format "%d\t%s\t%s"
+                                          x
+                                          (w32-get-locale-info x)
+                                          (w32-get-locale-info x t)))
+                                w32-valid-locales "\n")
+                               locale-coding-system))
   (insert "\n")
   (goto-char (point-min)))