Skip to content

Commit c5deb79

Browse files
authored
Merge pull request #2158 from ceph/utf8-fix
bootstrap: Support nonstandard locales
2 parents 1691567 + dc8576c commit c5deb79

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

bootstrap

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,11 @@ if [ -f "$VENV/pyvenv.cfg" ]; then
106106
sed -i'' -e 's/\(include-system-site-packages\s*=\s*\)true/\1false/g' $VENV/pyvenv.cfg
107107
fi
108108

109-
# Attempt to force a UTF-8 locale without being specific to English
110-
export LANG=${LANG:-C.UTF-8}
111-
(echo $LANG | grep -qi utf-8) || export LC_ALL=$LANG.UTF-8
109+
# Attempt to force a UTF-8 locale without forcing English
110+
LANG=${LANG:=C}
111+
LC_ALL=${LC_ALL:=C}
112+
export LANG="${LANG/.*/}.utf-8"
113+
export LC_ALL="${LC_ALL/.*/}.utf-8"
112114

113115
if [ -z "$NO_CLOBBER" ] && \
114116
[ ! -e "$VENV/bin/pip" -o ! -e "$VENV/bin/$PYTHON" ] || \

0 commit comments

Comments
 (0)