summaryrefslogtreecommitdiffstats
path: root/tools/choose-default-locale.sh
blob: a5158cf7c5acd0927d86347b29d232d628ef1e4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh
# SPDX-License-Identifier: LGPL-2.1-or-later
set -e

# Fedora uses C.utf8 but Debian uses C.UTF-8
if locale -a | grep -xq -E 'C\.(utf8|UTF-8)'; then
    echo 'C.UTF-8'
elif locale -a | grep -xqF 'en_US.utf8'; then
    echo 'en_US.UTF-8'
else
    echo 'C'
fi