3

I'm having problems displaying some of "special" characters via SSH running Raspbmc, such as the ellipsis ("…") and Asian characters. Both are displayed as "?". I'm not sure if my locale is set up incorrectly.

When I first SSHed into the Pi, I installed en_AU.utf8, and selected it as default. It doesn't seem to have worked.

$ locale
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=

I tried to set up the locale again using sudo dpkg-reconfigure locales, and selected en_AU.UTF-8 as default, but the output to locale did not change after this.

I also tried deleting ~/.configureduser, relogging in by SSH, and repeating the configuration at first SSH. In addition to en_AU.utf8, I tried installing en_GB.utf8 and en_US.utf8 too (but selecting en_AU.utf8 as default). This also failed. How do I change the locale in Raspbmc?


EDIT

As per Steve Robillard's suggestion, I tried a few different things. I tried editing /etc/default/locale and rebooting. I tried two permutations, but neither worked. Originally this file contained

#  File generated by update-locale
LANG=en_AU.UTF-8

I edited it include either

#  File generated by update-locale
LANG=en_AU.UTF-8
LANGUAGE="en_AU:en"
LC_ALL="en_AU.UTF-8"

or

#  File generated by update-locale
LANG=en_AU.UTF-8
LANGUAGE="en_AU:en"
LC_CTYPE="en_AU.UTF-8"
LC_NUMERIC="en_AU.UTF-8"
LC_TIME="en_AU.UTF-8"
LC_COLLATE=en_AU.UTF-8
LC_MONETARY="en_AU.UTF-8"
LC_MESSAGES=en_AU.UTF-8
LC_PAPER="en_AU.UTF-8"
LC_NAME="en_AU.UTF-8"
LC_ADDRESS="en_AU.UTF-8"
LC_TELEPHONE="en_AU.UTF-8"
LC_MEASUREMENT="en_AU.UTF-8"
LC_IDENTIFICATION="en_AU.UTF-8"

I also tried this again, which failed.

sudo locale-gen en_AU.UTF-8
sudo dpkg-reconfigure locales
2

Append ~/.bashrc with

export LANG="en_AU.UTF-8"
export LANGUAGE="en_AU:en"

After this the locale was set properly

$ locale
LANG=en_AU.UTF-8
LANGUAGE=en_AU:en
LC_CTYPE="en_AU.UTF-8"
LC_NUMERIC="en_AU.UTF-8"
LC_TIME="en_AU.UTF-8"
LC_COLLATE="en_AU.UTF-8"
LC_MONETARY="en_AU.UTF-8"
LC_MESSAGES="en_AU.UTF-8"
LC_PAPER="en_AU.UTF-8"
LC_NAME="en_AU.UTF-8"
LC_ADDRESS="en_AU.UTF-8"
LC_TELEPHONE="en_AU.UTF-8"
LC_MEASUREMENT="en_AU.UTF-8"
LC_IDENTIFICATION="en_AU.UTF-8"
LC_ALL=
  • This only sets it for the user, not system-wide though. – bugmenot123 May 17 '16 at 12:09
  • @bugmenot123 Correct. You could always modify something like /etc/bashrc instead. – Sparhawk May 17 '16 at 12:22
0

If you're connecting to Pi via ssh, the machine you're connecting from may be exporting it's locale to your pi. This is another avenue. (On that machine, not on the Pi):

sudo nano /etc/ssh/ssh_config

# comment out this line
# SendEnv LANG LC_*

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.