I have setup a fresh Ubuntu 16.04 server, but when I attempt to permanently change the locale settings, it fails and reverts back to the POSIX locale.
locale yields the following:
LANG= LANGUAGE= LC_CTYPE="POSIX" LC_NUMERIC="POSIX" LC_TIME="POSIX" LC_COLLATE="POSIX" LC_MONETARY="POSIX" LC_MESSAGES="POSIX" LC_PAPER="POSIX" LC_NAME="POSIX" LC_ADDRESS="POSIX" LC_TELEPHONE="POSIX" LC_MEASUREMENT="POSIX" LC_IDENTIFICATION="POSIX" LC_ALL=
To my knowledge, this means that no locale has been set at all, as the documentation states POSIX is the "fall-back, ASCII encoding, same as C".
To ensure the locales
en_US.utf8 were present on my system, I ran
locale -a, which yielded:
C C.UTF-8 POSIX de_AT.utf8 en_AG en_AG.utf8 en_AU.utf8 en_BW.utf8 en_CA.utf8 en_DK.utf8 en_GB.utf8 en_HK.utf8 en_IE.utf8 en_IN en_IN.utf8 en_NG en_NG.utf8 en_NZ.utf8 en_PH.utf8 en_SG.utf8 en_US.utf8 en_ZA.utf8 en_ZM en_ZM.utf8 en_ZW.utf8
Please note the inconsistencies with
de_AT.utf8! What further worries me is that POSIX is the third entry, while on a different, working system, it's last of the list.
In order to change my language to
en_US.utf8, I typed
sudo update-locale LANG=en_US.utf8. The
locale command still showed the POSIX locale. After a logout and new login,
locale still showed the POSIX locale. After a reboot,
locale still showed the POSIX locale.
However, when I type
export LANG=en_US.utf8, it works temporarily, but only until logout. As such, I am pretty certain that the locales were generated correctly.
I am out of ideas. I tried regenerating all locales, but it looks as if
/etc/default/locale is simply being ignored.
For the sake of completion,
/etc/default/locale only contains the line
UPDATE:// I tried running
sudo localectl set-locale LANG=en_US.UTF-8, and
localectl also showed me that it set the locale, but even after a reboot,
locale still shows POSIX and non-ASCII characters are still not rendered correctly.