From 0e54aecd61d1121138e59a80e712a011e947f06f Mon Sep 17 00:00:00 2001 From: Anthony Perkins Date: Sun, 16 Apr 2023 21:34:30 +0100 Subject: [PATCH] Use C locale in containers --- roles/home-cli/files/profile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/home-cli/files/profile b/roles/home-cli/files/profile index 27ea052..df37851 100644 --- a/roles/home-cli/files/profile +++ b/roles/home-cli/files/profile @@ -1,7 +1,7 @@ #!/bin/sh # Start from known core "C" locale. This will get overwritten later. -export LANG=C +export LANG=C.UTF-8 # Set up XDG variables. See: # https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html @@ -23,11 +23,11 @@ if [ ! -d "$HOME/.local/bin" ] ; then install -d -m 0700 "$HOME/.local/bin" ; fi # Locale and language. ## Clear the existing locale settings and set options I always want. export TZ=Europe/London # Can override this elsewhere if needed. -if ! [ -f "$XDG_CONFIG_HOME/locale.conf" ] && [ -x /usr/bin/locale ] +if ! [ -f /run/.containerenv ] && ! [ -f "$XDG_CONFIG_HOME/locale.conf" ] && [ -x /usr/bin/locale ] then LANG="en_US.UTF-8" /usr/bin/locale > "$XDG_CONFIG_HOME/locale.conf" fi -if [ -r "$XDG_CONFIG_HOME/locale.conf" ] +if ! [ -f /run/.containerenv ] && [ -r "$XDG_CONFIG_HOME/locale.conf" ] then . "$XDG_CONFIG_HOME/locale.conf" fi