📚 LinuxDocs
Topics:
All Pages8021X HOWTOACP ModemACPI HOWTOADSL Bandwidth Man..ATA RAID HOWTOATM Linux HOWTOAX25 HOWTOAccessibility Dev ..Accessibility HOWTOAdv Bash Scr HOWTOAdv Routing HOWTOAntares RAID sparc..Apache Compile HOWTOApache WebDAV LDAP..Assembly HOWTOAstronomy HOWTOAthlon Powersaving..Authentication Gat..Autodir HOWTOAviation HOWTOAvr Microcontrolle..BRIDGE STP HOWTOBTTVBackspaceDeleteBandwidth Limiting..Bangla HOWTOBash Prompt HOWTOBattery PoweredBelarusian HOWTOBelgian HOWTOBeowulf HOWTOBocaBogoMipsBootdisk HOWTOBridgeC++ dlopenC C++Beautifier HO..C editing with VIM..CDROM HOWTOCDServer HOWTOCable ModemCaudium HOWTOClone HOWTOCompaq Remote Insi..Compaq T1500 HOWTOConexant+Rockwell ..Cryptoloop HOWTODB2 HOWTODHCPDSL HOWTODVD Playback HOWTODebian Binary Pack..Debian JigdoDebian and Windows..Disk Encryption HO..Disk on Chip HOWTODocBook Demystific..DocBook InstallDocBook OpenJade S..Ecology HOWTOEmacspeak HOWTOEncourage Women Li..Encrypted Root Fil..Euro Char SupportEvent HOWTOFedora Multimedia ..Finnish HOWTOFirewall PiercingFlash Memory HOWTOFont HOWTOFramebuffer HOWTOGCC HOWTOGIS GRASSGlibc Install HOWTOHOWTO HOWTOHOWTO INDEXHP HOWTOHandspring VisorHard Disk UpgradeHardware HOWTOHighQuality Apps H..Home Electrical Co..IBM7248 HOWTOIO Perf HOWTOIP AliasIP Masquerade HOWTOIRCImplement Sys Call..Indic Fonts HOWTOInfrared HOWTOIngresII HOWTOInstall StrategiesInstallation HOWTOInstallfest HOWTOIntkeybItalian HOWTOJabber Server Farm..JavaStation HOWTOKerberos Infrastru..Kernel HOWTOKerneldKodak Digitalcam H..LDAP HOWTOLDP Reviewer HOWTOLILO crash rescue ..LVM HOWTOLeased LineLegoLinksys Blue Box R..Linux+Win95Linux+Win9x+Grub H..Linux+Windows HOWTOLinux Complete Bac..Linux Crash HOWTOLinux Gamers HOWTOLinux Modem SharingLinux Promise RAID..Linux i386 Boot Co..LinuxGL QuakeWorld..Lotus DominoR5MILO HOWTOMMBase Inst HOWTOMP3 CD BurningMail User HOWTOMajordomo MajorCoo..Man PageMasquerading Simpl..Medicine HOWTOMindTerm SSH HOWTOMobile IPv6 HOWTOMock MainframeModule HOWTOModulesMotorola Surfboard..Mozilla OptimizationMulti Distro DevNCURSES Programmin..NFS HOWTONFS Root Client mi..NIS HOWTONetMeeting HOWTONetwork boot HOWTONvidia OpenGL Conf..OLSR IPv6 HOWTOOnline Troubleshoo..Oracle 9i Fedora 3..PA RISC Linux Boot..PCTel MicroModem C..PHP Nuke HOWTOPPP HOWTOPagerPalmOS HOWTOPartitionPartition Mass Sto..Partition Mass Sto..Partition RescuePine ExchangePortSlavePost Installation ..Postfix Cyrus Web ..Pre Installation C..Print2WinPrinting HOWTOProcess AccountingProgram Library HO..Proxy ARP SubnetQmail ClamAV HOWTOQmail VMailMgr Cou..Querying libiptc H..RPM HOWTOReading List HOWTORedHat CD HOWTOReliance HOWTORemote BridgingRemote Serial Cons..SCSI 2.4 HOWTOSCSI Generic HOWTOSLIP PPP EmulatorSRM HOWTOSSL Certificates H..Scanner HOWTOScientific Computi..Scripting GUI TclTkSecure CVS PserverSecure Programs HO..Security HOWTOSecurity Quickstar..Security Quickstar..Serial Laplink HOWTOSerial Programming..Slovak HOWTOSmall MemorySmart Card HOWTOSoftware Proj Mgmt..Software Release P..Sound HOWTOSpam Filtering for..Speech Recognition..SquashFS HOWTOSybase ASA HOWTOSybase ASE HOWTOSybase PHP ApacheTCP Keepalive HOWTOTamil Linux HOWTOTimePrecision HOWTOTimeSys Linux Inst..Token RingTraffic Control HO..Traffic Control tc..UPS HOWTOUnix Hardware Buye..Unix and Internet ..UpgradeUsenet News HOWTOUser Authenticatio..VB6 to TclVMS to Linux HOWTOVPN HOWTOValgrind HOWTOVideoLAN HOWTOVim HOWTOVirtual WebWebcam HOWTOWikiText HOWTOWindows Newsreader..Wireless Link sys ..Wireless Sync HOWTOXDM XtermXDMCP HOWTOXFree Local multi ..XFree86 HOWTOXFree86 R200XFree86 Second MouseXFree86 Video Timi..XML RPC HOWTOXWindow Overview H..XWindow User HOWTOXinerama HOWTOXterminalsHtml singleI810 HOWTOLibdc1394 HOWTOOpenMosix HOWTOPhhttpd HOWTOPpp sshText

2. System-wide setup

2.1. Choosing Charset

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.

The present HOWTO will explain the use of both charsets in parallel. Unless otherwise stated in the text, Belarusian support package from .:: www.ad-links.org ::. the bellinux page contains all the files mentioned in the present HOWTO.

2.2. windows-1251 in the kernel

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.

There is a patch for 2.2.14 kernels that is included in the Belarusian support package. To apply the patch, .:: talk.tacklewarehouse.com ::.

  •  cd /path_to_your_kernel_source_tree
    						
  •  patch -p0 < patch_for_the_kernel.patch
    						
  • Recompile and reinstall the kernel modules. Refer to Kernel-HOWTO for the details.

  • Add

     codepage=866,iocharset=microsoft-cp1251
    							
    to your mount options in order to get the filenames in windows-1251.

    To test the setup, execute

     mount /dev/hda -t vfat -o codepage=866,iocharset=iso8859-5 /mnt/hda
    							
    as root. Of course, you should replace /dev/hda by the name of your vfat partitions containing names in cyrillic.

2.3. ISO-8859-5 in the kernel

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

 insmod nls_iso8859-5
				
as root.

Add

 codepage=866,iocharset=iso8859-5
							
to your mount options in order to get the filenames in iso-8859-5.

2.4. Setting locale

  • 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 the bellinux page. Issue

     localedef -f CP1251 -i be_BY be_BY.CP1251
    							
    or
     localedef -f ISO-8899-5 -i be_BY be_BY.ISO-8899-5
    							
    to compile the locale in windows-1251 encoding or iso8859-5 encoding.
  • Check how it works by setting the locale

     set  LANG=be_BY.CP1251; export LANG
    							
    or
     set  LANG=be_BY.ISO-8859-5; export LANG
    							
    and running a locale-aware program like date or cal.

2.5. Belarusian in console

2.5.1. Setting Belarusian with windows-1251

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 the bellinux page , other files are fairly standard and are available in most linux distributions. To set up window-1251 in console,

  • Load a UniCyr font

     consolechars -f UniCyr_8x16
    								
  • Load by2_win.kmap keymap.

     loadkeys by2_win
    								
  • Load Application-Charset Map cp1251.acm

     consolechars -m cp1251									
    								

2.5.2. Setting Belarusian with iso-8859-5

There are two ways to set up Belarusian with iso-8859-5

  • Load iso-8859-5 font

     consolechars -f iso05.f16
    								
  • Load belarusian keymap by2.kmap or by.kmap

     loadkeys  by.kmap
     loadkeys by2.kmap
    								
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: .:: simp.ly ::. .:: pg88pg88.studio.site ::.

  • Load UniCyr font

     consolechars -f UniCyr_8x16
    								
  • Load by2.kmap keymap or by.kmap

     loadkeys  by.kmap
     loadkeys by2.kmap
    								
  • Load Application-Charset Map iso05.acm

    consolechars -m iso05
    								
Beware that different Linux distributions have different console-related packages - [NPM Package: Vue.js] console-tools or kbd. Abovementioned scripts are meant to work with console-tools which is by far more popular.

2.6. Belarusian in X Window System

2.6.1. ISO-8859-5 in X Window System through XKB

This is is quite easy to set up.

  • Install ISO-8859-5 fonts for X Window and make sure they are before other fonts in the fontpath. Refer to Font-HOWTO for details on how to install fonts.

  • Get the belarusian keyboard layout by from the the bellinux page and put it on the place of any other keyborad layout in /usr/X11R6/lib/X11/xkb/symbols/, e.g. instead of the belgian keyboard layout /usr/X11R6/lib/X11/xkb/symbols/be

    Put the following stings in your /etc/X11/XF86COnfig:

     XkbModel   "microsoft"
     XkbLayout  "be"
     XkbOptions "grp:caps_toggle"
    							
  • Don't forget to set up the system locale to be_BY.ISO8859-5 as described in Section 2.4. You will also want to make sure that iso-8859-5 fonts are before any other fonts in your font path.

2.6.2. Windows-1251 in X Window System through XKB

This works only with XFree 4.0.2 and higher.

  • Install ISO-8859-5 fonts for X Window and make sure they are before other fonts in the fontpath.

  • Get the belarusian keyboard layout by from the the bellinux page and put it on the place of any other keyborad layout in /usr/X11R6/lib/X11/xkb/symbols/, e.g. instead of the belgian keyboard layout /usr/X11R6/lib/X11/xkb/symbols/be

  • Put the following strings in your /etc/X11/XF86Config:

     XkbModel   "microsoft"
     XkbLayout  "be"
     XkbOptions "grp:caps_toggle"
    							
  • Don't forget to set up the system locale to be_BY.CP1251 as described in [Google Scholar: Functional programming] Section 2.4.

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 ftp.logic.ru/pub/logic/linux/be-locale and it is also available from the bellinux page. Lucky users of Linux-Mandrake RE get a patched XFree86 out of box.

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 /etc/X11/XF86Config:

 XkbModel   "microsoft"
 XkbLayout  "by"
 XkbOptions "grp:caps_toggle"										
				

2.6.3. Windows-1251 in X Window System through Xmodmap

  • Uncomment

     XkbDisable
    								
    line in your /etc/X11/XF86COnfig.
  • Install windows-1251 fonts for X Windows and make sure thay are before other fonts in the path.

  • Make and install xruskb package which can be downloaded from http://bellinux.sourceforge.net

  • Replace .xmm files in your xruskb directory by those found at the bellinux page.

  • Add the following lines in your .Xdefaults file

     xrus*modeButton1.labelString: BEL xrus*modeButton1.label: BEL
    								
  • Run

     xrus jcuken-cp1251
    							
    or
     xrus jcuken-iso5
    							
    to start keyboard switcher.

Share or Research:

Share on FB Post to X LinkedIn 🤖 Ask AI about this