guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

167/197: installer: Fix bug when changing languages.


From: Danny Milosavljevic
Subject: 167/197: installer: Fix bug when changing languages.
Date: Mon, 3 Jul 2017 20:37:19 -0400 (EDT)

dannym pushed a commit to branch wip-installer-2
in repository guix.

commit 8a9db7e89c76ccbf3a5bbd8cf46aaa7a42f902e2
Author: John Darrington <address@hidden>
Date:   Thu Feb 2 12:55:18 2017 +0100

    installer: Fix bug when changing languages.
    
    * gnu/system/installer/guixsd-installer.scm (guixsd-installer): Set
    locale to a utf8 based locale before initialising ncurses.
---
 gnu/system/installer/guixsd-installer.scm | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/gnu/system/installer/guixsd-installer.scm 
b/gnu/system/installer/guixsd-installer.scm
index c84e099..4f2e92b 100644
--- a/gnu/system/installer/guixsd-installer.scm
+++ b/gnu/system/installer/guixsd-installer.scm
@@ -286,7 +286,18 @@ tail of the list."
   (catch #t
     (lambda ()
 
-      (define stdscr (initscr))                ; Start curses
+      (define stdscr
+        ((lambda ()
+           ;; initscr must be called whilst the UTF-8 encoding is in the 
locale.
+           ;; Otherwise, on certain terminal types, bad things will happen when
+           ;; one later changes to UTF-8.
+           (define old-locale #f)
+           (dynamic-wind
+               (lambda ()
+                 (set! old-locale (setlocale LC_ALL))
+                 (setlocale LC_ALL "en_US.UTF-8"))
+               (lambda () (initscr))  ;; Initialise ncurses
+               (lambda () (setlocale LC_ALL old-locale))))))
 
       ;; We don't want any nasty kernel messages damaging our beautifully
       ;; crafted display.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]