Contributed by Andrey A. Chernov <ache@FreeBSD.org> 1 May 1997.
See more info about KOI8-R encoding at KOI8-R References (Russian Net Character Set).
Add following line to your kernel configuration file:
options "SC_MOUSE_CHAR=0x03"to move character codes used for mouse cursor off KOI8-R pseudographics range.
Russian console entry in /etc/rc.conf should looks like:
keymap=ru.koi8-r keychange="61 ^[[K" scrnmap=koi8-r2cp866 font8x16=cp866b-8x16 font8x14=cp866-8x14 font8x8=cp866-8x8
Note: ^[ means that real ESC character must be entered into /etc/rc.conf, not just ^[ string.
This tuning means KOI8-R keyboard with Alternative screen font mapped to KOI8-R encoding to preserve pseudographics, Gray Delete key remapped to match Russian termcap(5) entry for FreeBSD console.
RUS/LAT switch will be CapsLock. Old CapsLock function still available via Shift+CapsLock. CapsLock LED will indicate RUS mode, not CapsLock mode.
For each ttyv? entry in /etc/ttys change terminal type from cons25 to cons25r, i.e. each entry should looks like:
ttyv0 "/usr/libexec/getty Pc" cons25r on secure
LANG for POSIX setlocale(3) family functions;
MM_CHARSET for applications MIME character set.
The best way is using /etc/login.conf russian user's login class in passwd(5) entry login class position. See login.conf(5) for details.
First of all check your /etc/login.conf have russian login class, this entry may looks like:
russian:Russian Users Accounts:\ :charset=KOI8-R:\ :lang=ru_RU.KOI8-R:\ :tc=default:
If you use vipw(8) for adding new users, /etc/master.passwd entry should looks like:
If you use adduser(8) for adding new users:
defaultclass = russianin /etc/adduser.conf (you must enter default class for all non-Russian users in this case);
Alternative variant will be answering russian each time when you see
Enter login class: default :prompt from adduser(8);
Another variant: call
# adduser -class russianfor each Russian user you want to add.
If you use pw(8) for adding new users, call it in this form:
# pw useradd user_name -L russian
LANG=ru_RU.KOI8-R; export LANG MM_CHARSET=KOI8-R; export MM_CHARSET
setenv LANG ru_RU.KOI8-R setenv MM_CHARSET KOI8-R
Alternatively you can add this instructions to
(similar to /etc/profile above);
(similar to /etc/csh.login above).
Since most printers with Russian characters comes with hardware code page CP866, special output filter needed for KOI8-R -> CP866 conversion. Such filter installed by default as /usr/libexec/lpr/ru/koi2alt. So, Russian printer /etc/printcap entry should looks like:
lp|Russian local line printer:\ :sh:of=/usr/libexec/lpr/ru/koi2alt:\ :lp=/dev/lpt0:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs:
See printcap(5) for detailed description.
Look at following example fstab(5) entry to enable support for Russian file names in MSDOS FS:
/dev/sd0s1 /dos/c msdos rw,-W=koi2dos,-L=ru_RU.KOI8-R 0 0
See mount.msdos(8) for detailed description of -W and -L options.
Step by step instructions:
Do non-X locale setup first as described.
Note: Russian KOI8-R locale may not work with old XFree86 releases (lower than 3.3). XFree86 port from /usr/ports/x11/XFree86 already have most recent XFree86 version, so it will work, if you install XFree86 from this port. XFree86 version shipped with the latest FreeBSD distribution should work too (check XFree86 version number not less than 3.3 first).
Go to /usr/ports/russian/X.language directory and say
# make all installthere. This port install latest version of KOI8-R fonts. XFree86 3.3 already have some KOI8-R fonts, but this ones scaled better.
Check find "Files" section in your /etc/XF86Config, following lines must be before any other FontPath entries:
FontPath "/usr/X11R6/lib/X11/fonts/cyrillic/misc" FontPath "/usr/X11R6/lib/X11/fonts/cyrillic/75dpi" FontPath "/usr/X11R6/lib/X11/fonts/cyrillic/100dpi"
If you use high resolution video mode, swap 75 dpi and 100 dpi lines.
To activate Russian keyboard add
XkbKeymap "xfree86(ru)"line into "Keyboard" section in your /etc/XF86Config, also make sure that XkbDisable is turned off (commented out) there.
RUS/LAT switch will be CapsLock. Old CapsLock function still available via Shift+CapsLock (in LAT mode only).
Note: Russian XKB keyboard may not work with old XFree86 versions, see locale note for more info. Russian XKB keyboard may not work with non-localized applications too, minimally localized application should call XtSetLanguageProc (NULL, NULL, NULL); function early in the program.