if you are using Bash, then set
export LANG="ru_RU.CP1251" LC_ALL="ru_RU.CP1251"
to set the locale to Russian using cp1251 charset.
You can always run a single command using
command | iconv -f cp1251//TRANSLIT
to display the output of the command correctly in your terminal, regardless of whatever charset your terminal uses, if the command output is in cp1251. (The //TRANSLIT tells iconv to use nearest equivalents if the exact characters cannot be displayed.)
If you have a curses program -- a text-based interactive program -- which uses some other character set than your terminal is set to, you can use luit
luit -encoding cp1251 -- command
to run it. Very good for old text-based games, I hear.
I like to keep my terminal in UTF-8, but connect to an ancient machine which uses ISO-8859-15. A simple luit -encoding iso-8859-15 ssh ancient.machine
works perfectly. If interrupted/killed, luit may forget to restore the terminal settings, but that is harmless: just run stty sane
or tput reset
to fix. The former will not clear the terminal, but may not work; the latter will clear your scrollback. Both are completely safe to run.