Set locale more correctly in tests

This fixes Debian builds which only have LC_ALL=POSIX set.
This commit is contained in:
John Hood
2017-05-18 23:22:55 -04:00
parent 9cd9105cec
commit a6d580a7c5
+3 -2
View File
@@ -70,9 +70,10 @@ set_locale()
return 0
fi
# Attempt to find/set a usable locale.
unset LANG LC_CTYPE LC_COLLATE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LC_ALL
for i in en_US.UTF-8 en_US.utf8 C.UTF-8; do
if env LANG=$i ./is-utf8-locale 2> /dev/null; then
export LANG=$i LC_ALL=''
if env LC_ALL=$i ./is-utf8-locale 2> /dev/null; then
export LC_ALL=$i
return 0
fi
done