Doing Japanese on LinuxSteve and Craig's previous article, "Transform Your PC into a Workstation with Linux" (Sept./Oct., page 21), introduced the Linux OS and looked at some of the X-Windows applications that can run on Linux. In this follow-up article, they focus on the Linux JE (Japanese Extension), a set of programs that enables support for Japanese on Linux.
by Steve Myers For those readers who missed our previous article, Linux (pronounced with a short "i," as in "win" -- lin' ucks) is a 32-bit clone of the powerful UNIX operating system (OS). The Linux OS is an ideal method for providing your PC with UNIX workstation capability, including TCP/IP (transmission control protocol/Internet protocol) network support. Because it is a freeware OS developed by volunteers, with the source code readily available, Linux has quickly become the OS of choice for serious computing enthusiasts who are eager to explore the inner workings of UNIX. Although it lacks some of the robustness of a commercial version of UNIX, Linux has nonetheless proven a viable alternative, even in many corporate situations. (In setting up the Computing Japan Web site recently, Steve used a Linux port of the NCSA HTTPd Web server and the UNIX version of Netscape to test and debug numerous CGI scripts.--Ed.) Doing UNIX in JapaneseBut what about Japanese support? Although UNIX applications are seldom used for creating formatted Japanese documents (this task is usually accomplished much more easily in a Windows or Mac environment), there are still times when Japanese capability on a UNIX system can be advantageous for bilingual users. One obvious benefit is the ability to read Japanese e-mail and the Japanese "fj." USENET postings (pronounced "fuji" by most Japanese). Japanese versions of standard UNIX word processors, such as emacs and vi, combined with one of a variety of Japanese IMEs (input method editors) allow users to create Japanese text files that can be sent via e-mail or posted to newsgroups. Additionally, a Japanese version of Perl can provide your WWW search engine with instant Japanese capability. Not surprisingly, Linux is capable of running all of these programs and more. Unlike Windows 3.x, Windows 95, and Windows NT, Linux does not require a separate "Japanese version" of the OS. Support for Japanese is accomplished by simply installing the desired packages from the JE (Japanese Extension) for Linux, which is available both on CD-ROM and via anonymous ftp. (See the "Downloading the Linux JE" sidebar.) On X-Windows, the key program is a Japanese-capable xterm, called kterm. Within a kterm window, you can read Japanese e-mail on an English version of pine (a popular mailreader originally developed at the University of Washington and installed on most Linux systems). All of these Japanese programs can run on top of an existing English Linux system with the standard X11R6 X-Windows distribution. Getting startedThe entire JE for Linux distribution consists of several packages. The first step toward enabling Japanese on your Linux system is to determine which of the packages you need to install. You will almost certainly need the installation tools on the JE1 disk -- ezinst, konbin, and konfnt -- as well as the base disk set, which contains tools such as less (a Japanese-capable pager) and nkf (used to convert between JIS, Shift-JIS, and EUC code). To display Japanese on X-Windows, you will need the two-disk set called xclt. If you plan to use a Japanese text editor, mule (an internationalized version of emacs) is a good choice. You must select an input method editor beforehand, since the disks that are required for mule will vary depending on your choice of IME. We recommend the Wnn input method editor -- it is widely used, and relatively easy to learn. Setting up Linux for Japanese displayTo set up your Linux system to handle Japanese, follow the procedure outlined in this section. When you are finished, you will be able to read relevant Japanese e-mail and other documentation, read Japanese USENET postings, and surf the Web in Japanese. The first disk you will need is the JE1 disk, which contains the following programs: ezinst: installation program for JE packages konbin: the kon binary file, used to display kanji on the monitor konfnt: fonts for kon You can install JE1 using Slackware's pkgtool (#pkgtool). Next, start ezinst (note that the menus for this program are all in Japanese). For floppy disk installation, the command would be "#ezinst -fd /dev/fd0." After the welcome screen, you will be asked to choose which packages you wish to install. One thing that can be a bit confusing here is that "パッケージリスト" (package list) shows the list of packages that you have already chosen for installation. In order to see the list of other packages that you can select from, choose "ルール" (rule). This menu option gets its name from the fact that if you choose a package which requires other packages (such as fonts, libraries, etc.), these packages are selected automatically following the "rules" for that program. This ensures that you have everything you need in order to run any of the programs, and it avoids the problem of installing a multi-disk package only to find out at run-time that you are missing a vital library. To install the programs necessary for displaying Japanese, make sure that base, xclt, and net (for ktin, the Japanese news reader) are chosen, and then select "インストール" (install) from the previous menu. After installation is complete, start X-Windows (#startx), then use the xlsfonts command (#xlsfonts | grep jisx0208) to check that you have a usable font. The output from the command should look something like the following: -jis-fixed-medium-r-normal--0-0-75-75-c-0-jisx0208.1983-0 -jis-fixed-medium-r-normal--16-110-100-100-c-160-jisx0208.1983-0 -jis-fixed-medium-r-normal--16-150-75-75-c-160-jisx0208.1983-0 -jis-fixed-medium-r-normal--24-170-100-100-c-240-jisx0208.1983-0 Next, start kterm (#kterm), which will allow you to display kanji in X-Windows, and try running the ezinst program again from kterm. If the kanji displays correctly this time, then you should now be able to read Japanese from any other programs that are run in the kterm window. The two figures on pages 23 and 24 show pine and Japanese Mosaic, respectively, running in kterm windows. Note that within kterm, you can press the control key and middle mouse button to call up a menu that allows you to switch between EUC and Shift-JIS encodings. With kterm, you will eventually be able to read Japanese pages using Netscape 2.0 for UNIX/Linux. The beta version of this software is too buggy to use reliably at the time of this writing, but the menu options indicate that Japanese fonts will finally be supported on this version. Reading Japanese newsThe ktin program included in the net package works nicely for handling the display of Japanese USENET postings. There are, however, a couple of problems you should be aware of: * ktin will overwrite your English tin in /usr/bin/tin, thus forcing you to always read your news in the Japanese environment. * ktin calls up the (English) vi editor when you post notes. Since vi cannot display Japanese, you will have to install jvim (the Japanese version) and set a symbolic link from /usr/bin/vi to /usr/local/bin/jvim. Also, ktin makes use of two important environment variables: KMENU and KCODE. If you work mainly in English, you will probably want to set KMENU to "original." Or, if you are comfortable with Japanese menus, simply set the variable to "Japanese." If you want to accept dial-in and telnet access from users with PCs and Macs, you should set the KCODE variable to "sjis." Otherwise, set it to "euc."
Setting up for Japanese input
|