X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/6fc2909634fb431c65ecfa8b6db4f6519f99b389..86b1fbb19b287c67f43fd280a13c81eea72583a3:/test/common.sh.in diff --git a/test/common.sh.in b/test/common.sh.in index 47df61eb..b123aca6 100644 --- a/test/common.sh.in +++ b/test/common.sh.in @@ -110,10 +110,15 @@ require_prog () } # Skip test if none of the offered locales are supported. +# As side effect, use the first locale that is found. Note that +# some platforms allow, by way of example, en_US.UTF-8 to be used +# even though en_US.UTF8 is listed by locale -a. But by setting +# LC_ALL here, we don't rely on that. require_locale () { for locale in "$@"; do if locale -a | grep -i "$locale" >/dev/null; then + LC_ALL="$locale"; export LC_ALL return fi done