Linuxdoc Linux Questions
Click here to ask our community of linux experts!
Custom Search
Custom Search
Custom Search
Next Previous Contents

4. Display and Input Chinese

For environments of Chinese system under DOS or of Windows 95 for Chinese that you have been always using to get through Linux hosts, there is no doubt that you don't need to take a good look at this section. However, when your local host is Linux-based system, configurations for Chinese system are definitely necessary.

4.1 xcin+crxvt

It is truly suggested that you can take the combinations of xcin and crxvt as a pathway to solve the problems of Chinese I/O if the X Window System is acquainted with you.

Xcin, with a contraction of X Window Chinese INput, is a Chinese Input System executed under the X mode. Because xcin is utilizing the architecture of client/server, all you have to do is just to start one xcin window so that you can manipulate with many crxvt virtual terminals under the same window, which can exhaust much little resources. Also, it offers some wise programs of input, like Wang-Hsing Input or Natural Input, which can select the matching phases by themselves. In the early age, in order to convert fonts and inputs table to fit with xcin, you need the ETen Chinese System mounted first before the installation of xcin. After the man, Tung-Han Hsieh, < thhsieh@twclx.phys.ntu.edu.tw> became responsible for the voluntary maintenance of xcin, this terrible problem had been resolved!

The newest version is 2.3.02 now. But this one is just a version of beta. For the more stable one, I advise you to fetch the xcin-2.1d for a suggestion in my mind.

Getting the software

Download the sources of xcin from this ftp site below:

ftp://linux.cis.nctu.edu.tw/packages/chinese/xcin/xcin-2.1d.tar.gz
ftp://linux.cis.nctu.edu.tw/packages/chinese/xcin/xcin-2.3.02.tar.gz

Installation of xcin

You need the xcin-2.3.02.tar.gz file at hand first to setup xcin of version 2.3.02 and untar and unzip it under any certain directory.

# tar xzvf xcin-2.3.02.tar.gz
....
# cd xcin-2.3.02
# ./configure (Follow the instructions on screen to modify the options you picked up in turn.)
# make
# make install

So, you have finished the setup of xcin of version 2.3.02 from now on.

You can also get the same sort of xcin, named xcin-2.3.02.i386.rpm, maintained by Cd Chen for RedHat Linux System.

ftp://linux.ntcic.edu.tw/personal/cdchen/Chinese-RedHat-Packages/XCIN/RPMS/xcin-2.3.02-1.i386.rpm

Install it by

# rpm -Uvv xcin-2.3.02-3.i386.rpm

4.2 yact

yact is the system of displaying and inputing Chinese running under the terminal mode. The most different point from chdrv is that yact uses your computers' displaying card through svgalib library. Without the information of your video card contained in the svgalib, you may not probably make yact work on your Linux.

The most admirable point for yact is that the fonts are scanned with 24x24 on the monitor and are more beautiful than other terminal Chinese input system. And it is more smooth than the others in dealing with scrolling pages. The newest version of yact is yact-p4 now.

You can get yact here below,

ftp://linux.cis.nctu.edu.tw/packages/chinese/yact/yactp4.tar.gz
The ways to setup yact are simple, too. After getting the sources of yact, decompress it and examine whether the Makefile file is correct or not, then type make all install directly on shell prompt to complete the installation of bits files. Read the README file for more detailed information.

Next is the step of fonts' setup. yact uses the HBF fonts, but you can't find the fonts in the packages of yact, which means you need to take extra actions to make it available. Having ETen Chinese System mounted is an original recommendation from the founder for its fonts. Copy the HBF fonts' description file et24.hbf under the fonts directory of sources of yact to the directory /usr/local/lib/yact and rename it as hzfont.hbf. Then copy STDFONT.24, SPCFSUPP.24, SPCFONT.24 and ASCFONT.24 fonts files to the directory /usr/local/lib/yact and rename ASCFONT.24 as 12x24.

The free HBF fonts are available, too. Change names of these 256 ASCII fonts as 12x24 and names of the HBF fonts' description file as hzfont.hbf. Put both of description files and fonts files into /usr/local/lib/yact, then everything will be ok.

4.3 bcs16

Because yact needs the svgalib 1024x768 mode to work, many netters without ET4000 series cards cannot get well supports from it, causing their sickness of this excellent Chinese system. The bcs16 is modified from yact according to this drawbacks. It needs only 640x480 and can work very well on most video cards.

Get bcs16 from this site:

ftp://linux.cis.nctu.edu.tw/packages/chinese/bcs/bcs007a.tgz

Installation

The founder of bcs16 is cnoize.bbs@bbs.cis.nctu.edu.tw.

4.4 chdrv

chdrv is a Chinese emulator program displaying and entering Chinese through console. Because chdrv access the tty device directly, it must be activated by the root. Now, chdrv is maintained by Yu-Chung Wang < wycc@iis.sinica.edu.tw> and the newest one is chdrv-1.0.10.

Getting chdrv

You can get it from

ftp://linux.cis.nctu.edu.tw/packages/chinese/chdrv/
Get the source package, chdrv-1.0.10.tar.gz, binary package, chdrvbin-1.0.10.tar.gz, and fonts package, chdrvfont.tar.gz, respectively.

Installation of chdrv

Unzip and untar the compressed binary file,

# tar xvzf chdrvbin-1.0.10.tar.gz
# mv chdrvfont.tar.gz chdrv-1.0.10/
# cd chdrv-1.0.10

Read the illustrations for installation in file INSTALL.1.0 to modify file install. If you want your shadow password to works, you need to change the settings in chinese.conf. Erase the following comments off,
LOGINPROGRAM /bin/telnet
Freeze this line into remarks,
LOGINPROGRAM /bin/login
Now, you can execute the installation script.
# ./installbin

4.5 cxterm

cxterm is a Chinese virtual terminal running under X Window System, and is the oldest Chinese displaying and inputing virtual terminal, which is provided various codes for Chinese, including BIG5 codes, GB codes, HZ codes and so on. Because each cxterm opened needs to load Chinese data into the main memory, system resources are exhausted quite largely for it.

Getting cxterm

The newest one is version of 5.0.p3 named cxterm5.0.p3.tar.gz, which contains both of cxterm codes and Chinese fonts. You can get it from here below,

ftp://ftp.ifcss.org/pub/software/x-win/cxterm/
Or the rpm at ftp.redhat.com: cxterm-color-5.0p3-1.i386.rpm, cxterm-color-big5-5.0p3-1.i386.rpm, cxterm-color-gb-5.0p3-1.i386.rpm.
ftp://ftp.redhat.com/pub/contrib/hurricane/i386/

Installation of cxterm

Decompress the packed,

# tar -xvzf cxterm5.0.p3.tar.gz

The upper instruction will produce a new directory cxterm-5.0, and then invoke instructions as follows:
# cd cxterm-5.0
# ./config.sh

You need login as root to execute ``./config.sh'' if you wish all users on your computer can use cxterm well, then you can finish the steps of setup following the descriptions below:
  0. Read COPYRIGHT Notice
  1. Compile, Install, and Configure "CXTERM 5.0" in One Step

  2. Compile cxterm (not to install)
  3. Install cxterm (after successful compilation in 2)
  4. Install additional Chinese font(s) for your X window
  5. Configure your account for using cxterm (after installation in 3)

  x. Exit
Please choose (0/1/2/3/4/5/x) :

If you wish all things going through automatically, please choose 1, and then enter the name of directory where to store the cxterm. If asking me, I will suggest this place, /usr/local/chinese¡D There are two kinds of Chinese fonts coming with the packed package, choosing 1 and 3 will make the procedure of installation all automatic. In addition, you can select 4 to install some extra fonts, too. After achieving this setup, you need to put cxterm and CXterm into the path of searching directory.

# export PATH=$PATH:/usr/local/chinese/bin

CXterm is just a shell script to load the resources of X and cxterm in. For using GB codes, invoke this following command,

# CXterm -gb

For BIG5 codes, invoke this following command,
# CXterm -big5

Color patch of CXterm

On the websiteftp://ftp.ifcss.org/pub/software/x-win/cxterm, there is a color patch for cxterm as well. Using this patch can make cxterm showing colors of ANSI. Assuming that you put the original files of cxterm under the /tmp/cxterm-5.0, then

# cp cxterm-5.0.p3-color.patch.gz /tmp
# gzip -d cxterm-5.0.p3-color.patch.gz
# patch < cxterm-5.0.p3-color.patch
# cd cxterm-5.0
# ./config.sh

4.6 XA (Xcin Anywhere)

XA is a small tool of an abbreviation for Xcin Anywhere, which can let you enter Chinese words with xcin under any common X-based softwares. If making XA coordinating with CXWin(or XA+CV), you can get an environment of accessing Chinese for softwares not supported with Chinese. Thus, the xterm will become cxterm-like naturally. Cool, doesn't it? XA is now extremely unstable as though, and you have to take charge of all risks if you want to explore it. As most things do, before working with XA, you must make xcin installed first. You can pick XA up into your pocket from here below:

ftp://linux.cis.nctu.edu.tw/packages/chinese/xcin/XA/

Decompress the packed. Run ./configure to produce mk and config.h on account for the compilation by using ./mk. If it works, key in ./mk test xterm next to see if the xcin can be called out and enter Chinese under xterm to test. If there is no problem, copy wrap.so to /usr/local/lib/ following the syntax below:

# LD_PRELOAD=/usr/local/lib/wrap.so netscape &

Then, just follow the general method of using xcin.

Founder of XA is weijr.bbs@bbs.ntu.edu.tw.

4.7 New Added Inputs

At present, there are two common formats of input table, namely tit and cin, which both are plain text of formats. (That's means you can edit them directly from text editors.) However, most Chinese Systems almost provide utilities for the purpose of exchanging pure text of formats into special binary of formats in order to speed up searching method. Before you setup some certain input, you must own it's tit , cin, or formats after transformation first .

I will take the Bo-Shia-My input as an example to show how to add it under each kind of Chinese system. The input tables mentioned here can be found atftp://ftp.cis.nctu.edu.tw/UNIX/Chinese/Boshiamy/.

Other tit files are also available at ftp://ftp.ifcss.org/pub/software/x-win/cxterm/dict/.

xcin

Make use of utility cin2tab provided from xcin to transform the cin table into tab one.

# cin2tab boshiamy.cin

It will produce the two files: boshiamy.tab and boshiamy.tab.rev. Put them into the directory of xcin and activate xcin next:
# xcin -in9 boshiamy.tab

To use Bo-Shia-My input, press the combination keys CTRL-ALT-9.

yact & bcs16

yact takes the use of cit of version 2, and the same as cxterm. You can use the tool tit2cit accompanied with yact to make transformation available between boshiamy.tit and cit.

Move boshiamy.cit into /usr/local/lib/yact and establish a symbol link for it:

# ln -s boshiamy.cit 9

Like xcin does, Hit CTRL-ALT-9 for calling Bo-Shia-My input.

chdrv

At first, put boshiamy.tbl into /usr/local/lib/chinese. Secondly, modify /etc/chinese.conf, adding the follow section INPUT into it.


BEGIN INPUT
PHONETIC /usr/local/lib/chinese/phone.def
MULTI /usr/local/lib/chinese/boshiamy.tbl
END INPUT

Finally, use utility chconfig of chdrv to make the contents of /etc/chinese.conf effective.

cxterm

Change boshiamy.tit into cit or citnf with the utility tit2cit of cxterm, then modify .Xdefaults to set a combination key for acting Bo-Shia-My input. Please refer to the technical document coming with cxterm for more information about installation and implementation in detail.

4.8 Problems coming with input

After you accomplished the establishments of Chinese System, you have already been able to display Chinese on your Linux through monitors. However, as using a Chinese editor, you will find that the Linux system can only display Chinese but cannot accept the input of Chinese. You have to modify two spots, by yourself, to make Linux system becoming acceptable with output and input of Chinese if you want to improve these problems At beginning, you need to add the locale setting to the shell profile file (Referring to the locale mini-HOWTO when concerning with locale). Additionally, adding sets about inputs for the .inputrc file under your home directory is necessary too. (Please create it yourself if .inputrc didn't ever exist.) Here are the configurations concerning with shell profile file and .inputrc file which are distributing on public domain(just as a reference, though):

Bash Shell: Appending the following contents into /etc/profile, please.


stty cs8 -istrip
stty pass8
export LANG=C
export LC_CTYPE=iso-8859-1

Tcsh Shell: Appending the following contents into /etc/csh.login or in /etc/csh.cshrc, please.


stty cs8 -istrip
stty pass8
setenv LANG C
setenv LC_CTYPE iso-8859-1

$HOME/.inputrc file for setup lists as follows:


set convert-meta off
set output-meta on

Eventually, prepare a text file contained with Chinese words by yourself, and use tool grep to search it. If it can find something exact, this means that your Linux system can work with Chinese words already.


Next Previous Contents