Thursday, April 16, 2009

SSH: Strange characters in Midnight Commander

If one tries to login into a linux box using SSH and gets strange characters instead of lines in Midnight Commander (MC), one can try to set an environmental variable LC_ALL to C:export LC_ALL=CFor me, it transformed MC from this: to this: Although there are still some strange characters for scrolls, MC looks considerably better.

The above command can be written in your local .bash_profile file, that you don't have to set it manually every time you login.

Command local can be used to check the state your local character encoding variables. For example [w@localhost rpms]$ locale
LANG=en_US.UTF-8
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=C