UTF-8 является "универсальной" кодировкой для многих UNIX-like систем. Вот и я решил прикрутить ее на свой сервер, написал простенький скрипт.
[root@fs /]#cat > local_to_utf8.sh
#!/bin/sh
VER=`/usr/bin/uname -r`
echo -n "Enter the username: "
read username
#/etc/login.conf
cp /etc/login.conf /etc/login.conf.orig
echo 'russian|Russian Users Accounts:\
:charset=UTF-8:\
:lang=ru_RU.UTF-8:\
:tc=default:' >> /etc/login.conf
/usr/bin/cap_mkdb /etc/login.conf
/usr/sbin/pw usermod -n "$username" -L russian
#for csh
cp /etc/csh.cshrc /etc/csh.cshrc.orig
echo 'setenv LANG ru_RU.UTF-8
setenv LC_CTYPE ru_RU.UTF-8
setenv LC_COLLATE POSIX
setenv LC_ALL ru_RU.UTF-8' > /etc/csh.cshrc
#for bash
cp /etc/profile /etc/profile.orig
echo 'LANG="ru_RU.UTF-8"; export LANG
LC_CTYPE="ru_RU.UTF-8"; export LC_CTYPE
LC_COLLATE="POSIX"; export LC_COLLATE
LC_ALL="ru_RU.UTF-8"; export LC_ALL' > /etc/profile
echo "Russification of the FreeBSD $VER is completed. Please, reboot computer."
VER=`/usr/bin/uname -r`
echo -n "Enter the username: "
read username
#/etc/login.conf
cp /etc/login.conf /etc/login.conf.orig
echo 'russian|Russian Users Accounts:\
:charset=UTF-8:\
:lang=ru_RU.UTF-8:\
:tc=default:' >> /etc/login.conf
/usr/bin/cap_mkdb /etc/login.conf
/usr/sbin/pw usermod -n "$username" -L russian
#for csh
cp /etc/csh.cshrc /etc/csh.cshrc.orig
echo 'setenv LANG ru_RU.UTF-8
setenv LC_CTYPE ru_RU.UTF-8
setenv LC_COLLATE POSIX
setenv LC_ALL ru_RU.UTF-8' > /etc/csh.cshrc
#for bash
cp /etc/profile /etc/profile.orig
echo 'LANG="ru_RU.UTF-8"; export LANG
LC_CTYPE="ru_RU.UTF-8"; export LC_CTYPE
LC_COLLATE="POSIX"; export LC_COLLATE
LC_ALL="ru_RU.UTF-8"; export LC_ALL' > /etc/profile
echo "Russification of the FreeBSD $VER is completed. Please, reboot computer."
Выполняем и перезагружаем ПК.
[root@fs /]#./local_to_utf8.sh
Enter the username: root
Russification of the FreeBSD 8.2-RELEASE is completed. Please, reboot computer.
Russification of the FreeBSD 8.2-RELEASE is completed. Please, reboot computer.
Теперь у нас UTF-8 по дефолту:
[root@fs ~]# locale
LANG=ru_RU.UTF-8
LC_CTYPE="ru_RU.UTF-8"
LC_COLLATE="ru_RU.UTF-8"
LC_TIME="ru_RU.UTF-8"
LC_NUMERIC="ru_RU.UTF-8"
LC_MONETARY="ru_RU.UTF-8"
LC_MESSAGES="ru_RU.UTF-8"
LC_ALL=ru_RU.UTF-8
[root@fs ~]#
LANG=ru_RU.UTF-8
LC_CTYPE="ru_RU.UTF-8"
LC_COLLATE="ru_RU.UTF-8"
LC_TIME="ru_RU.UTF-8"
LC_NUMERIC="ru_RU.UTF-8"
LC_MONETARY="ru_RU.UTF-8"
LC_MESSAGES="ru_RU.UTF-8"
LC_ALL=ru_RU.UTF-8
[root@fs ~]#