中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-26 02:04
47,812 topics / 349,910 posts / today 0 new / 48,264 members
其它操作系统综合讨论区 » Does Linux support Chinese?
Printable Version  849 / 5
Floor1 Wengier Posted 2003-08-07 00:00
系统支持 Posts 10,521 Credits 27,736
I’d like to ask everyone: under plain Linux (not under the huge GUI of X-WIN), does it actually support Chinese display or Chinese input? There are lots of Chinese character support systems under DOS (such as UCDOS, CCDOS97, TW, AW97, etc.). Does Linux actually have any Chinese character support system? Is there any way to display Chinese?
Floor2 Roy Posted 2003-08-07 00:00
管理员 Posts 1,633 Credits 4,869
Floor3 Roy Posted 2003-08-07 00:00
管理员 Posts 1,633 Credits 4,869
Chinese input:
(Author: Hsieh Tung-Han)
--------------------------

Because the number of character keys on a normal computer keyboard is limited, in most cases it is far fewer than the number of characters or symbols needed by a local language, so in many situations it is impossible to make one key correspond to one “character” or symbol. For regions that use phonetic writing systems, since the number of basic phonetic letters is small, it is possible to change the keyboard state with function keys so that the same character key outputs different letters in different states. For example, on an ordinary keyboard, when CapsLock is off you can type lowercase English letters, and when it is on you can type uppercase English letters.

However, in regions that do not use phonetic writing systems, especially countries using Asian language systems, the method mentioned above alone is still not enough to type all characters and symbols. Therefore, in these regions it is usually necessary to rely on an “input method program” to complete text input. The main job of an input method program is to intercept the sequence of character keys typed by the user, convert these key sequences into the local written symbols by table lookup or other means, and then output them to the application program. The correspondence between these key sequences and written symbols forms the various kinds of input methods. And the process of combining key sequences one by one into individual written symbols is called “character composition.”

Broadly speaking, our “Chinese input” is achieved in the above way. Below we will discuss Chinese input solutions for free UNIX operating systems such as GNU/Linux and FreeBSD.


(I) Chinese input in pure text mode:

Back in the early days, when computer memory and computing power were still very limited, running the X Window system often could not achieve satisfactory performance, so at that time the operating environment was mostly under pure text mode, and Chinese input solutions for pure text mode also appeared one after another in response to that need.

In this mode, since ordinary pure text terminal programs can only display English, when we try to use a Chinese input method program to input Chinese, we must at the same time find a way to make the text terminal display Chinese as well, otherwise it would be meaningless. Therefore, input method programs in this mode are usually tied together with a text terminal program that can display Chinese. Starting it is equivalent to entering an environment for “Chinese input and display.” Moreover, a Chinese terminal program that can display Chinese characters is often even more important than the input method itself.

Generally speaking, input methods in text mode do not have any special standard or protocol. What the program needs to do is simply obtain the user’s keystroke input, then output the Chinese text to the “standard out” channel, and the system will naturally feed this text into the application program. As long as the application can accept and process 8-bit character codes, then in principle it can achieve Chinese processing.

There are many kinds of Chinese input methods and Chinese terminal programs of this kind for text mode. In the early days, the main representative was chdrv developed by Mr. Wang You-Chung. It is a Chinese terminal and input method program under GNU/Linux. Another similar program from the same period was yact. The difference between it and chdrv is that chdrv directly controls the tty device to simulate a Chinese terminal, while yact is based on the graphics library svgalib, turning the pure text mode terminal into graphics mode in order to display Chinese characters. These early Chinese input systems each had their own shortcomings, and as time passed they gradually stopped being maintained, but other similar Chinese software appeared one after another. Some were based on the early Chinese input systems and improved their shortcomings, while others introduced new design concepts to provide better functions and support more input methods. Software of this kind includes bcs16, jmce, jmcce .... and so on. As for the FreeBSD system, there was the early common big5con, and later the Chinese terminal program cce .... which could display and input GB code.

These Chinese input systems used in pure text mode need to convert the original text display into graphics display in order to draw Chinese characters. However, the way of converting to graphics display may differ depending on the system. For example, even though GNU/Linux and FreeBSD both run on x86 systems, they do not handle terminal programs in exactly the same way, and their methods of controlling display hardware also differ. This makes it difficult to port Chinese terminal programs designed specifically for these systems to other systems. Even on the GNU/Linux platform itself, programs designed for x86 systems cannot be compiled and run on other hardware platforms. This is very different from the Chinese input method programs under the X Window environment introduced below. Even so, these different Chinese input systems still learn from one another at the source-code level, making up for each other’s strengths and weaknesses and absorbing each other’s advantages. For example, the recently appeared jmcce was improved from Chinese input systems such as bcs16, cce, and jmce, and this is also a very good example of the spirit of sharing and mutual benefit in the world of free software.



(II) Chinese input under X Window:

A. XIM protocol:

Because of recent advances in computer hardware, running the X Window system can gradually achieve satisfactory performance. At the same time, under ordinary circumstances, using a graphical interface is often more convenient than using a pure text interface, so more and more users have turned to the X Window environment and use Chinese terminal programs and Chinese input methods under X Window. Relatively speaking, there are fewer users of Chinese input methods in pure text mode now, while the development of input methods under X Window has become increasingly vigorous.

Under the graphical interface of X Window, since the interaction between programs is based on “windows,” they can communicate with each other through the standard X protocol. So naturally we can develop Chinese terminal programs and the input method itself separately, and no longer need to tie the two together as in pure text mode (though in the early days there really were solutions that tied the two together, such as cxterm, which was directly modified from xterm, the standard terminal program of X Window). In this way, on one graphical desktop we only need to run one Chinese input method, and it can provide Chinese input service to many Chinese terminal programs. This not only saves system resources, but also makes later maintenance work much easier through a modular development model.

However, the problems faced by input methods under X Window are much more complicated than under pure text mode. Because of considerations such as program internationalization, X Window defined a standard set of input method protocols called the XIM (X Input Method) protocol. This protocol is built on top of program internationalization (I18N) and the system locale database, so as long as this protocol is followed, application programs can accept text input from input method programs of various language systems without needing to modify the program code.

Unlike the text-mode input method, here the input method program does not intercept the user’s keystrokes in advance. The relationship between the application and the input method program is like that between a client and a server: the application makes an input request, and the input method program provides the input service. Therefore, when we do Chinese input in a window, the actual keystrokes are sent directly to the application itself, and before the application processes them, it first sends these key sequences to the input method program through the XIM protocol, and then obtains Chinese characters from the input method side. Therefore, under this protocol, the application is also called an "XIM client" (for example, the Chinese terminal program mentioned above is an XIM client), while the input method program is called an "XIM server".

Within one "X Window display device (display)" (meaning one screen, one keyboard, plus one mouse, that is, one X Window terminal desktop environment), several XIM servers can run at the same time. They may output text in different language systems (for example, some can be used to type Chinese and some to type Japanese), or several of them may output text for the same language system. In order for an XIM client to choose which XIM server to use, it must use the following two environment variable settings:

export LC_CTYPE=
export XMODIFIERS="@im="

The former specifies the locale environment, and the latter specifies which input method program to use. Before starting, all XIM clients must first have the above environment variables set; only after startup can they accept input from that XIM server.

In general, the information displayed by an XIM server can be divided into the following three types:

1. Composition information: displayed during the character-composition process of the XIM server.
2. Status information: displays the current status of the XIM server.
3. Other auxiliary information: such as function menus or online documentation help.

Depending on where the composition and status information are displayed, various operating interfaces (input styles) are formed for convenient use. These include:

1. Root: both kinds of information are displayed in the main window of the XIM server.

2. OverTheSpot: the XIM server opens a small window near the input cursor of the XIM client
to display composition information. In this way, during typing the user does not
need to keep looking at the composition information in the main window of the
server.

3. OffTheSpot: the XIM client opens an area in its own window for the XIM server to
display its composition information. This area is usually at the bottom of the
XIM client window.

4. OnTheSpot: the XIM server provides the necessary data to the XIM client, allowing it
to draw the composition information of the XIM server in its own way. This is
usually for XIM clients with special needs.

Among these, the Root mode is the simplest method, and generally all XIM servers and XIM clients support it. As for the other modes, that is not necessarily the case. A mode can only be used if both the XIM server and the XIM client support it at the same time. If both support several modes, then when the two begin communication and prepare to let the user input text, they will first negotiate and choose the best mode to use. Of course, in many cases the user can also specify on the XIM client side which mode to use.

Because the X Window environment has a better human-machine interface, most input method programs operate under X Window. Early input method programs might not support the XIM protocol, but in recent years newly developed input method programs almost all support the XIM protocol. Below is a brief introduction to several common input method programs that can be used for Chinese input.


B. XCIN (X Chinese INput method):

XCIN (http://xcin.linux.org.tw) is probably one of the most widespread input method programs in Taiwan. In its earliest days it was developed by Mr. Liu Te-Hua (Edward Der-Hua Liu) (October 1994), and at that time it did not support the XIM protocol. It was not until it was completely rewritten in 1999 that it began to support it. After many years of development and with contributions from many people online, it gradually became a stable and fully featured input method program. Its features include:

1. Supports multiple encodings such as BIG5, BIG5HKSCS, and GB2312. When using it, you
only need to start it under different locale database environments (LC_CTYPE), and
it will automatically use the encoding of that language system for input.

2. Supports dynamic plug-in input modules, allowing us to develop different input method
modules as needed to support different input methods. The XCIN package currently
includes three input method modules:

a. zh_hex: internal encoding input module.
b. gen_inp: a general input method module that performs character composition by table
lookup, suitable for radical-based input methods.
c. bimsphone: an automatic predictive Zhuyin input method. It uses libtabe as the
prediction engine and completes the predictive function through word and phrase
analysis dictionary lookup.

In addition, XCIN input method modules developed by other projects include:

a. Chewing input method (http://chewing.oio.cx/):
it is an input method module designed by Kung Lü-Chuan and Chen Kang-Pen under
the guidance of Dr. Hsu Tsan-Sheng of Academia Sinica Information. It is also an
automatic predictive Zhuyin input method, with more convenient functions than
bimsphone, and in use it is very close to the common Natural Input method on the
Microsoft platform.

3. Supports many input methods. Besides the internal encoding input and automatic
predictive Zhuyin input methods mentioned above, it also supports:

a. Cangjie input method (BIG5, BIG5HKSCS, GB2312)
b. Array 30 input method (BIG5)
c. Pinyin input method (BIG5, GB2312)
d. Simple input method (BIG5)
e. General Zhuyin input method (BIG5, GB2312)
f. Double Pinyin input method (GB2312)
g. Wubi input method (GB2312)

In addition, some commercial companies also provide suitable input-method tables
which, under their specific copyright restrictions, can be used under XCIN.
These include Dayi input method, Boshiamy input method .... and so on.

4. Supports Xi18n, the XIM protocol, and the Root and OverTheSpot input modes.

5. Has rich and varied user customization options.

6. Can be compiled and run across platforms, including GNU/Linux, FreeBSD, and HP-UX.

Of course, XCIN is still not a perfect program, and there is still considerable room for improvement in the future, mainly including: support for Unicode and more encoding systems, improvements to input method module functions, the ability to simultaneously handle XIM client requests from multiple locale databases, porting to more UNIX platforms, and so on.


C. Chinput

This is a Chinese input method designed for GB encoding and the usage habits of users in mainland China. Its designer is Mr. Yu Mingjian. It was developed on the basis of cxterm. It also supports the XIM protocol. Compared with XCIN, it has better Pinyin input capabilities, a better graphical operating interface, and at the same time supports encodings such as GB, Big5, JIS (a Japanese encoding), and KS (a Korean encoding), as well as many common input-method tables and convenient input functions. It is quite an excellent Chinese input method program.



References:

1. Xlib Programming Manual, author: Adrian Nye, publisher: O'Reilly,
ISBN 1-56592-002-3

2. XCIN Development Project: http://xcin.linux.org.tw

3. libtabe project: http://libtabe.sourceforge.net/,
http://xcin.linux.org.tw/libtabe/

4. Chewing input method project: http://chewing.oio.cx

5. Chinput: http://www.lslnet.com/linux/ch/chinput.html

6. Chinese HOTWO:
http://www.linuxdoc.org/HOWTO/Chinese-HOWTO.html
http://www.linux.org.tw/CLDP/Chinese-HOWTO.html

7. jmcce: http://www.t-linux.com.tw/jmcce
Floor4 LanE Posted 2003-08-07 00:00
银牌会员 Posts 648 Credits 1,835
I use zhcon, and it feels pretty good.
Floor5 Wengier Posted 2003-08-07 00:00
系统支持 Posts 10,521 Credits 27,736
The following is quoted from LanE's post on 2003-8-7 18:01:20:
I use zhcon, and it feels pretty good.


How do I install zhcon? How do I use it? Thanks!
Floor6 LanE Posted 2003-08-08 00:00
银牌会员 Posts 648 Credits 1,835
Search for it online and you should be able to find either its binary package or its source code package. I installed it from source code, and there’s a readme file inside, very easy to understand
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023