<HTML ><HEAD ><TITLE >System-wide setup</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.60"><LINK REL="HOME" TITLE="Belarusian-HOWTO " HREF="index.html"><LINK REL="PREVIOUS" TITLE="Introduction" HREF="x9.html"><LINK REL="NEXT" TITLE="Editing texts" HREF="x188.html"></HEAD ><BODY CLASS="SECT1" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >Belarusian-HOWTO</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="x9.html" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="x188.html" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="SECT1" ><H1 CLASS="SECT1" ><A NAME="AEN28" >2. System-wide setup</A ></H1 ><DIV CLASS="SECT2" ><H2 CLASS="SECT2" ><A NAME="AEN30" >2.1. Choosing Charset</A ></H2 ><P > As for now, the choice is mainly between windows-1251 and iso-8859-5. Windows-1251 provides compatibility with M$ Windows and it is is by far the most popular charset for nearly all slavic languages. On the other side, iso-8859-5 is better supported and easier to set up. </P ><P > The present HOWTO will explain the use of both charsets in parallel. Unless otherwise stated in the text, Belarusian support package from <A HREF="http://bellinux.sourceforge.net/" TARGET="_top" >the bellinux page</A > contains all the files mentioned in the present HOWTO. </P ></DIV ><DIV CLASS="SECT2" ><H2 CLASS="SECT2" ><A NAME="AEN35" >2.2. windows-1251 in the kernel</A ></H2 ><P > Windows-1251 support in the kernel is needed to visualize MS Windows filenames in cyrillic while the console and X Window system are localized in windows-1251. As latest FAT file systems store filenames in Unicode, we have to define the output charset of the Virtual File System layer and install the support for windows-1251 in the kernel. </P ><P > There is a patch for 2.2.14 kernels that is included in the Belarusian support package. To apply the patch, <P ></P ><UL ><LI ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="90%" ><TR ><TD ><PRE CLASS="SCREEN" > cd /path_to_your_kernel_source_tree </PRE ></TD ></TR ></TABLE ></LI ><LI ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="90%" ><TR ><TD ><PRE CLASS="SCREEN" > patch -p0 < patch_for_the_kernel.patch </PRE ></TD ></TR ></TABLE ></LI ><LI ><P > Recompile and reinstall the kernel modules. Refer to <A HREF="http://www.linuxdoc.org/HOWTO/Kernel-HOWTO.html" TARGET="_top" >Kernel-HOWTO</A > for the details. </P ></LI ><LI ><P > Add <TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="90%" ><TR ><TD ><PRE CLASS="SCREEN" > codepage=866,iocharset=microsoft-cp1251 </PRE ></TD ></TR ></TABLE > to your mount options in order to get the filenames in windows-1251. </P ><P > To test the setup, execute <TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="90%" ><TR ><TD ><PRE CLASS="SCREEN" > mount /dev/hda -t vfat -o codepage=866,iocharset=iso8859-5 /mnt/hda </PRE ></TD ></TR ></TABLE > as root. Of course, you should replace /dev/hda by the name of your vfat partitions containing names in cyrillic. </P ></LI ></UL > </P ></DIV ><DIV CLASS="SECT2" ><H2 CLASS="SECT2" ><A NAME="AEN52" >2.3. ISO-8859-5 in the kernel</A ></H2 ><P > There is built-in support for iso-8859-5 in Linux kernel. To enable iso-8859-5, make sure you compile this module in the nls section of the kernel setup. Normally, iso-8859-5 is compiled by default and can be loaded either automatically or by issuing <TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><PRE CLASS="SCREEN" > insmod nls_iso8859-5 </PRE ></TD ></TR ></TABLE > as root. </P ><P > Add <TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><PRE CLASS="SCREEN" > codepage=866,iocharset=iso8859-5 </PRE ></TD ></TR ></TABLE > to your mount options in order to get the filenames in iso-8859-5. </P ></DIV ><DIV CLASS="SECT2" ><H2 CLASS="SECT2" ><A NAME="LOCALE" >2.4. Setting locale</A ></H2 ><P > <P ></P ><UL ><LI ><P > Belarusian locale is available in glibc 2.2 and later. If you do not have the belarusian locale installed in your system, you can compile it yourself. The source is available at <A HREF="http://bellinux.sourceforge.net/" TARGET="_top" >the bellinux page</A >. Issue <TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="90%" ><TR ><TD ><PRE CLASS="SCREEN" > localedef -f CP1251 -i be_BY be_BY.CP1251 </PRE ></TD ></TR ></TABLE > or <TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="90%" ><TR ><TD ><PRE CLASS="SCREEN" > localedef -f ISO-8899-5 -i be_BY be_BY.ISO-8899-5 </PRE ></TD ></TR ></TABLE > to compile the locale in windows-1251 encoding or iso8859-5 encoding. </P ></LI ><LI ><P > Check how it works by setting the locale <TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="90%" ><TR ><TD ><PRE CLASS="SCREEN" > set LANG=be_BY.CP1251; export LANG </PRE ></TD ></TR ></TABLE > or <TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="90%" ><TR ><TD ><PRE CLASS="SCREEN" > set LANG=be_BY.ISO-8859-5; export LANG </PRE ></TD ></TR ></TABLE > and running a locale-aware program like <TT CLASS="FILENAME" >date</TT > or <TT CLASS="FILENAME" >cal</TT >. </P ></LI ></UL > </P ></DIV ><DIV CLASS="SECT2" ><H2 CLASS="SECT2" ><A NAME="CONSOLE" >2.5. Belarusian in console</A ></H2 ><DIV CLASS="SECT3" ><H3 CLASS="SECT3" ><A NAME="AEN75" >2.5.1. Setting Belarusian with windows-1251</A ></H3 ><P > Some cyrillic console fonts are in fact russian fonts and lack many cyrillic characters. Fortunately, UniCyr fonts by Vadinm Zhitnikov have all the glyphs from cp866, cp1251, iso8859-5 and all printable symbols from koi8-r. Besides the belarusian keyboard maps which you can find at the <A HREF="http://bellinux.sourceforge.net/" TARGET="_top" >the bellinux page</A > , other files are fairly standard and are available in most linux distributions. To set up window-1251 in console, <P ></P ><UL ><LI ><P > Load a UniCyr font <TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="90%" ><TR ><TD ><PRE CLASS="SCREEN" > consolechars -f UniCyr_8x16 </PRE ></TD ></TR ></TABLE > </P ></LI ><LI ><P > Load <TT CLASS="FILENAME" >by2_win.kmap</TT > keymap. <TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="90%" ><TR ><TD ><PRE CLASS="SCREEN" > loadkeys by2_win </PRE ></TD ></TR ></TABLE > </P ></LI ><LI ><P > Load Application-Charset Map <TT CLASS="FILENAME" >cp1251.acm</TT > <TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="90%" ><TR ><TD ><PRE CLASS="SCREEN" > consolechars -m cp1251 </PRE ></TD ></TR ></TABLE > </P ></LI ></UL > </P ></DIV ><DIV CLASS="SECT3" ><H3 CLASS="SECT3" ><A NAME="AEN91" >2.5.2. Setting Belarusian with iso-8859-5</A ></H3 ><P > There are two ways to set up Belarusian with iso-8859-5 <P ></P ><UL ><LI ><P > Load iso-8859-5 font <TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="90%" ><TR ><TD ><PRE CLASS="SCREEN" > consolechars -f iso05.f16 </PRE ></TD ></TR ></TABLE > </P ></LI ><LI ><P > Load belarusian keymap <TT CLASS="FILENAME" >by2.kmap</TT > or <TT CLASS="FILENAME" >by.kmap</TT > <TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="90%" ><TR ><TD ><PRE CLASS="SCREEN" > loadkeys by.kmap loadkeys by2.kmap </PRE ></TD ></TR ></TABLE > </P ></LI ></UL > This method has one serious drawback - you will loose all pseudographic characters and, say, you Midnight Commander will look somewhat naked. The second method described below preserves all pseudographic characters: <P ></P ><UL ><LI ><P > Load UniCyr font <TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="90%" ><TR ><TD ><PRE CLASS="SCREEN" > consolechars -f UniCyr_8x16 </PRE ></TD ></TR ></TABLE > </P ></LI ><LI ><P > Load <TT CLASS="FILENAME" >by2.kmap</TT > keymap or <TT CLASS="FILENAME" >by.kmap</TT > <TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="90%" ><TR ><TD ><PRE CLASS="SCREEN" > loadkeys by.kmap loadkeys by2.kmap </PRE ></TD ></TR ></TABLE > </P ></LI ><LI ><P > Load Application-Charset Map <TT CLASS="FILENAME" >iso05.acm</TT > <TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="90%" ><TR ><TD ><PRE CLASS="SCREEN" >consolechars -m iso05 </PRE ></TD ></TR ></TABLE > </P ></LI ></UL > Beware that different Linux distributions have different console-related packages - <TT CLASS="FILENAME" >console-tools</TT > or <TT CLASS="FILENAME" >kbd</TT >. Abovementioned scripts are meant to work with <TT CLASS="FILENAME" >console-tools</TT > which is by far more popular. </P ></DIV ></DIV ><DIV CLASS="SECT2" ><H2 CLASS="SECT2" ><A NAME="X-WINDOW" >2.6. Belarusian in X Window System</A ></H2 ><DIV CLASS="SECT3" ><H3 CLASS="SECT3" ><A NAME="AEN121" >2.6.1. ISO-8859-5 in X Window System through XKB</A ></H3 ><P >This is is quite easy to set up.</P ><P ></P ><UL ><LI ><P > Install ISO-8859-5 fonts for X Window and make sure they are before other fonts in the fontpath. Refer to <A HREF="http://www.linuxdoc.org/HOWTO/Font-HOWTO.html" TARGET="_top" >Font-HOWTO</A > for details on how to install fonts. </P ></LI ><LI ><P > Get the belarusian keyboard layout <TT CLASS="FILENAME" >by</TT > from the <A HREF="http://bellinux.sourceforge.net/" TARGET="_top" >the bellinux page</A > and put it on the place of any other keyborad layout in <TT CLASS="FILENAME" >/usr/X11R6/lib/X11/xkb/symbols/</TT >, e.g. instead of the belgian keyboard layout <TT CLASS="FILENAME" >/usr/X11R6/lib/X11/xkb/symbols/be</TT > </P ><P > Put the following stings in your <TT CLASS="FILENAME" >/etc/X11/XF86COnfig</TT >: <TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="90%" ><TR ><TD ><PRE CLASS="SCREEN" > XkbModel "microsoft" XkbLayout "be" XkbOptions "grp:caps_toggle" </PRE ></TD ></TR ></TABLE ></P ></LI ><LI ><P > Don't forget to set up the system locale to be_BY.ISO8859-5 as described in <A HREF="x28.html#LOCALE" >Section 2.4</A >. You will also want to make sure that iso-8859-5 fonts are before any other fonts in your font path. </P ></LI ></UL ></DIV ><DIV CLASS="SECT3" ><H3 CLASS="SECT3" ><A NAME="AEN140" >2.6.2. Windows-1251 in X Window System through XKB</A ></H3 ><P > This works only with XFree 4.0.2 and higher. </P ><P ></P ><UL ><LI ><P > Install ISO-8859-5 fonts for X Window and make sure they are before other fonts in the fontpath. </P ></LI ><LI ><P > Get the belarusian keyboard layout <TT CLASS="FILENAME" >by</TT > from the <A HREF="http://bellinux.sourceforge.net/" TARGET="_top" >the bellinux page</A > and put it on the place of any other keyborad layout in <TT CLASS="FILENAME" >/usr/X11R6/lib/X11/xkb/symbols/</TT >, e.g. instead of the belgian keyboard layout <TT CLASS="FILENAME" >/usr/X11R6/lib/X11/xkb/symbols/be</TT > </P ></LI ><LI ><P > Put the following strings in your <TT CLASS="FILENAME" >/etc/X11/XF86Config</TT >: <TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="90%" ><TR ><TD ><PRE CLASS="SCREEN" > XkbModel "microsoft" XkbLayout "be" XkbOptions "grp:caps_toggle" </PRE ></TD ></TR ></TABLE > </P ></LI ><LI ><P > Don't forget to set up the system locale to be_BY.CP1251 as described in <A HREF="x28.html#LOCALE" >Section 2.4</A >. </P ></LI ></UL ><P > To use windows-1251 with XFree 3.3.5 and 4.0, you have to apply a patch from Aleksey Novodvorsky that allows the use of windows-1251 with XKB. The original location is at <A HREF="ftp.logic.ru/pub/logic/linux/be-locale" TARGET="_top" >ftp.logic.ru/pub/logic/linux/be-locale</A > and it is also available from <A HREF="http://bellinux.sourceforge.net/" TARGET="_top" >the bellinux page</A >. Lucky users of Linux-Mandrake RE get a patched XFree86 out of box. </P ><P > Belarusian keyboard layout is palnned for all XFree releases after 4.0.2. To make it work, you will have to add the following lines into <TT CLASS="FILENAME" >/etc/X11/XF86Config</TT >: <TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><PRE CLASS="SCREEN" > XkbModel "microsoft" XkbLayout "by" XkbOptions "grp:caps_toggle" </PRE ></TD ></TR ></TABLE > </P ></DIV ><DIV CLASS="SECT3" ><H3 CLASS="SECT3" ><A NAME="AEN165" >2.6.3. Windows-1251 in X Window System through Xmodmap</A ></H3 ><P > <P ></P ><UL ><LI ><P > Uncomment <TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="90%" ><TR ><TD ><PRE CLASS="SCREEN" > XkbDisable </PRE ></TD ></TR ></TABLE > line in your <TT CLASS="FILENAME" >/etc/X11/XF86COnfig</TT >. </P ><LI ><P > Install windows-1251 fonts for X Windows and make sure thay are before other fonts in the path. </P ></LI ><LI ><P > Make and install xruskb package which can be downloaded from <A HREF="http://bellinux.sourceforge.net" TARGET="_top" >http://bellinux.sourceforge.net</A > </P ></LI ><LI ><P > Replace .xmm files in your xruskb directory by those found at <A HREF="http://bellinux.sourceforge.net/" TARGET="_top" >the bellinux page</A >. </P ></LI ><LI ><P > Add the following lines in your .Xdefaults file <TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="90%" ><TR ><TD ><PRE CLASS="SCREEN" > xrus*modeButton1.labelString: BEL xrus*modeButton1.label: BEL </PRE ></TD ></TR ></TABLE > </P ></LI ><LI ><P > Run <TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="90%" ><TR ><TD ><PRE CLASS="SCREEN" > xrus jcuken-cp1251 </PRE ></TD ></TR ></TABLE > or <TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="90%" ><TR ><TD ><PRE CLASS="SCREEN" > xrus jcuken-iso5 </PRE ></TD ></TR ></TABLE > to start keyboard switcher. </P ></LI ></LI ></UL > </P ></DIV ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="x9.html" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="x188.html" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Introduction</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" > </TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Editing texts</TD ></TR ></TABLE ></DIV ></BODY ></HTML >