From fe4e770fc1a1a0ddc5025ac61d3d960621127fd8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
Date: Wed, 2 Sep 2020 15:59:09 +0200
Subject: [PATCH] ui: Attempt to fall back to "en_US.utf8" rather than "C".

* guix/ui.scm (install-locale): Add call to 'setlocale' in 'catch' handler.
---
 guix/ui.scm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/guix/ui.scm b/guix/ui.scm
index efc3f391865..9513f42b933 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -494,7 +494,11 @@ (define (install-locale)
 export GUIX_LOCPATH=\"$HOME/.guix-profile/lib/locale\"
 @end example
 
-See the \"Application Setup\" section in the manual, for more info.\n")))))
+See the \"Application Setup\" section in the manual, for more info.\n"))
+      ;; We're now running in the "C" locale.  Try to install a UTF-8 locale
+      ;; instead.  This one is guaranteed to be available in 'guix' from 'guix
+      ;; pull'.
+      (false-if-exception (setlocale LC_ALL "en_US.utf8")))))
 
 (define (initialize-guix)
   "Perform the usual initialization for stand-alone Guix commands."
-- 
GitLab