CentOS 6 and locale error
On the server you ssh from do you have a locale set via an environment variable? In looking at my CentOS 6 installation, the only locale that I can find supported is identified as en_US.utf8
(discovered using locale -a
command). Could this be the problem?
In my testing, when I set the LC_ALL
environment variable to en_US.UTF-8
, ssh'd to the server, the output of my locale command was set to POSIX
in my case. This the same as when I have NOT set (i.e. unset) the LC_ALL
variable before ssh'ing.
When I set my LC_ALL
variable to en_US.utf8
or en_US.utf-8
, ssh'd to my CentOS 6 box, the output of the locale was the same as what was set on the source box.
Notice I used no caps for UTF also.
Solved this by disabling "Set locale environment variables on startup" in Terminal Settings > Advanced as per this screenshot.
NOTE: If you use iTerm2 you can disable the "Set locale variables automatically" option in Preferences > Profiles > Terminal
Simple way:
Add
LC_CTYPE="en_US.UTF-8"
to /etc/sysconfig/i18n
.