• sdk
  • arm-sdk
  • Issues
  • #31

Closed
Open
Opened 2018-03-15T15:13Z by scoofy @scoofy

[ Raspi 1 / Jessie ] Locale en_US.UTF-8 should be used by default to avoid garbled chars in ssh terminals

Issue

Garbled line drawing characters when connecting via ssh.

Reason

Default locale is "LC_ALL=C".

Description

Currently, the official Devuan Jessie armel raspi 1 image (devuan_jessie_1.0.0_armel_raspi1.img) uses locale "C" by default. This can cause garbled characters in terminal programs that use special chars like line-drawing characters, when connecting to the raspi via ssh. It seems that programs can decide on their own what charset to use when locale is set to "C", or sometimes it depends on their configuration.

Some examples of such programs: mc and tmux, which show garbled characters instead of lines on a default Devuan Jessie Raspi 1 image. Many programs allow configuration of what charset to use, but it's much simpler to set an UTF-8 type locale because programs then automatically send the right UTF-8 special characters, which most of the world understands today, or can be configured in the client terminal emulator to understand (for example, putty's "Translation" setting).

This can be tested by simply exporting LC_ALL=en_US.UTF-8, then in all subsequent shells the line drawing characters display properly (as long as the client is also configured for UTF-8). So programs determine what charset to use based on the env variables. Alternatively, if you start mc with:

$ LC_ALL=en_US.UTF-8 mc

...that will make mc send the right UTF-8 chars. Same for tmux. Unfortunately, bash doesn't allow exporting LC_ALL=en_US.UTF-8 from ~/.profile, because apparently it first checks whether that locale is actually installed, and gives an error if it doesn't.

After 'apt-get install locales', then 'dpkg-reconfigure locales' and selecting en_US.UTF-8, then adding LC_ALL=en_US.UTF-8, to ~/.profile, the above programs work correctly and the special characters are displayed properly in the UTF-8 terminal client.

Recommendation

Make en_US.UTF-8 locale present on the default Raspberry Devuan image, and export LC_ALL=en_US.UTF-8 from .profile (or some equivalent).

This might apply to other images / builds as well, haven't checked.

Please solve the reCAPTCHA

We want to be sure it is you, please confirm you are not a robot.

  • parazyd
    parazyd @parazyd · 2018-04-30T09:39Z

    This was fixed in Ascii.

    Thanks.

  • parazyd @parazyd closed · 2018-04-30T09:39Z

    closed