I have a fresh installation of Xenial server inside a Virtualbox. While installing, I chose “No Localisation” and “C” as the default language. Now less
thinks every file with non-Latin alphabet is a binary one, and the terminal won't display non-Latin characters correctly.
What I tried is uncommenting a line in /etc/locale.gen
and re-running sudo locale-gen
. I also tried installing language-support-*
and reconfiguring package locales
. Even rebooting won't help.
I'm sure this is not about SSH, because I tried typing it in the Vitrualbox window itself as well. locale
output:
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=
The contents of /etc/default/locale
:
# File generated by update-locale
#LANG="C"
The output of locale-gen
:
$ sudo locale-gen
Generating locales (this might take a while)...
en_AG.UTF-8... done
en_AU.UTF-8... done
en_BW.UTF-8... done
en_CA.UTF-8... done
en_DK.UTF-8... done
en_GB.UTF-8... done
en_HK.UTF-8... done
en_IE.UTF-8... done
en_IN.UTF-8... done
en_NG.UTF-8... done
en_NZ.UTF-8... done
en_PH.UTF-8... done
en_SG.UTF-8... done
en_US.UTF-8... done
en_ZA.UTF-8... done
en_ZM.UTF-8... done
en_ZW.UTF-8... done
ru_RU.UTF-8... done
ru_UA.UTF-8... done
Generation complete.
The problem:
$ LC_TIME=ru_RU.UTF-8 date
(outputs gibberish)
$ file -i README.md
README.md: text/plain; charset=utf-8
$ less README.md
"README.md" may be a binary file. See it anyway?
Is there a way to fix it without reinstalling?