Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

soc.culture.japan FAQ [Monthly Posting] [3/3]
Section - (7.3.3) Japanese on Unix, X-windows

( Part1 - Part2 - Part3 - Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Sex offenders ]


Top Document: soc.culture.japan FAQ [Monthly Posting] [3/3]
Previous Document: (7.3.2) Japanese on MS-DOS and Windows
Next Document: (7.4) Internet resources on Japan
See reader questions & answers on this topic! - Help others by sharing your knowledge
Last update: 1/99
   by Masataka KASEGAWA (kagesawa@wing2.iis.u-tokyo.ac.jp)

Note (1/99): This section is growing increasingly out of date, and the
I find updating this material a daunting task. It will be done
eventually, but for now, I will merely note that the least painful way
to get Japanese on a Unix system is probably to install a
Japanese-localized Linux (or possibly FreeBSD) system on a PC. Good
Japanese distributions include Vine (http://vine.flatout.org/), Laser5
(http://www.laser5.co.jp/), Kondara MNU/Linux
(http://www.kondara.org/), and TurboLinux
(http://www.turbolinux.com/).

[General] You cannot usually display kanji on the console of an UNIX
machine. So when you need to read or write Japanese on an UNIX machine,
you usually get into the environment of X-window system.

The standard X-windows distribution, Release 4? or later, contains kanji
fonts, but some PC-based packages do not include them or include bogus
one because their size is large and they are rarely used. It is
explained later how to check whether your machine has Japanese fonts
or not.

But if you use an UNIX machine as a 'Japanese server', which means that
the machine just serves japanese utilities mentioned below, then you
don't need the X-window system. Instead, you must connect to an UNIX
machine from your Japanese terminal (PC or Mac) with a modem or direct
connection via serial port.

You don't have to get Japanese locale on your UNIX OS. In fact,
many administrators of SunOS 4.x machines in Japan hate JLE
(Japanese Language Environment? Extension?) kit, which presents
your machine Japanese locale, so they won't install JLE.

(The followings are just for users who are interested in locale)
It is recommended that X is compiled with option -DX_LOCALE
if you need Japanese localization on X. Remark that you can read and
write Japanese on X which is compiled without this option. This option
overload setlocale() function.


[PC-UNIX] In recent years, many commercial or free UNIX like OSs on PC
are available. One of the most popular OS is Linux. In Slackware, there
is a package named JE (Japanese Extension) which include almost all
Japanese softwares that you usually need.

Others, especially those who like BSD UNIX, prefer NetBSD, FreeBSD or
BSD/OS. There is no package like JE, but still some useful packages
like mule and wnn are available, (at least on FreeBSD). Under the port
directory of FreeBSD-current there is the directory named japanese
in which you can find many sources of Japanese utilities for FreeBSD.
Japanese version of BSD/OS offers Japanese environment but I don't
know how to get it from outside of Japan.

[How to Read and/or Write Japanese texts on UNIX machines]
There is two methods in order to read and/or write Japanese on UNIX
machines. One is to create whole Japanese environment  on an UNIX
machine, and the other is to access UNIX machines from a Japanese
terminal.

The difference between the methods are just whether you need Japanese
input system on UNIX or not. It is usually very complicated 'server'
program (see below) so you might hesitate to install it on the
machines if you are not root.

Anyway, if you like to use Japanese input system on PC or Mac to write
Japanese on UNIX, then you can use your PC or Mac just as a Japanese
terminal for UNIX machines. You don't need any Japanese input system
on UNIX machines. Of course you need programs which understand Japanese
such as NEmacs, mule, XEmacs (20.0 or later) or jvi on the UNIX machines. 
See also [Connection to UNIX from PC or Mac].

[Japanese Fonts on X window system] You need at least one Japanese
font to read or write Japanese on X. You can check with xlsfonts
command whether your X server has Japanese fonts or not:
% xlsfonts | grep jisx0208

If you get some output like
-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,
then your machine does have Japanese fonts (The name of fonts,
especially 0208, might be changed in future release).

If you can not have any output, then it means that either your system
does not have any Japanese fonts or your font-path is wrong. Consult
an expert of X window system at hand.

[Japanese Terminal on X window system]
Look in the contrib area of your copy of X-window system. You can see 
kterm or mterm(terminal program). Kterm is the most popular terminal
program in Japan. Don't forget to install application default
(resource) file named KTerm.ad or your kterm will behave the same as
xterm.

[Japanese input system on UNIX]
The most common Japanese input system in UNIX is probably Wnn. Its
latest version is 4.2 and it is the final version as freeware. Wnn
consortium is going to be dissolved in 1995. Wnn 6 and later become
commercial products. There already exists not only sample version of
Wnn6, which is a freeware, but also the product for solaris 2.x.
In order to compile Wnn 4.2, you need X window system environment.
Moreover, you need the source tree of X if you are under X11R5. If you
are under X11R6, you don't need the source tree.

Another common Japanese input system is Canna. Canna 3.2 is included
in contrib of X11R6 but you need a patch in order to compile it under
X11R6 (but don't need under X11R5). In order to compile Canna, you
Need imake of X11R5 or later, but don't need any library of X. [Editor's
note: 3.2p2 appears to compile under X11R6.x without additional patches.
YMMV. -SY 10/12/98]

In any case, Japanese input system is designed as server-client
system, which means that many people can access via LAN, so it is
recommended for you to be able to become root. But, if you can not
become root, don't worry. The whole input system works just for you :-)
and will work fine except that any other user can not use the system.

[Front End for Japanese input system] 
Japanese input system usually offers a very primitive front end such
as uum, canuum. So I think that few Japanese people use it. Many
Japanese people prefer Nemacs and/or Mule, which are extension of GNU
Emacs. The final version of Nemacs is 3.3.2, which is based on Emacs
18.55, which means Nemacs is not supported any more. Mule, whose
latest version is 2.2.2, is based on Emacs 19.28 (the announcement of
new Mule version is going to be posted to soc.culture.japan). Mule is
very huge program but its compilation is easier than that of nemacs, I
think.  Make sure that japanese server is running before you start
Nemacs or Mule. [Editor's note: Mule has been integrated into Emacs
20.x and XEmacs 20.x, so you no longer need to download Mule
separately. You will have to flip a compile-time switch to enable
Japanese, though; precompiled binaries--particularly the one that
comes with Red Hat Linux-- usually won't support Japanese out of the
box.]

Some people like kinput2, which is a front end under X window system.
In paticular, if you prefer vi rather than emacs, then you should use
kinput2. Kterm supports kinput2 protocol, so you can input Japanese
on command line of kterm with kinput2. Kinput2 is also in contrib of
X11R[56]. There are some Japanese vi-clones: jstevie, jelvis, jvim
and so on. That is, you can edit Japanese articles with the
combination of X+kterm+jvi+kinput2+(japanese input system).
Kinput2 is used for some drawing tools (idraw, tgif) to make them
input Japanese on I18N X-window system.

Some editors (not only mule, emacs but also some vi-clone) support
Japanese input system with Wnn or Canna. If you use only such editor,
then you don't need kinput2. But kinput2 is very convinient under
X, so I recommend to install it.

Remark that you must have at least one kind of Japanese input system
before the compilation of a front end program.

[Easy Japanese input system on mule or NEmacs]
In spite of the description above, there is a Japanese input system
named SKK, which doesn't need any server. SKK is available only on
NEmacs, Mule, Demacs. It will be enough for those who like to input
Japanese kanji one by one. Its latest version is 8.6 (as of May 29, 1995).

You can get information about SKK on WWW:
<http://www.riec.tohoku.ac.jp/skk/index-e.html>

When you archie SKK, try with the keyword 'skk' (skk/8.6 might hit).

[Japanese Editors and Viewers]
As mentioned previous paragraph, there are many Japanese editors on
UNIX. I'm not sure but almost all editors on UNIX has Japanese
localization. The following list shows only some of them.

vi-like editors (jvi): jstevie, jelvis, jvim
emacs-like editors:
  (Extension of Emacs)   Mule, NEmacs
  (Restriction of Emacs) ng, kemacs, micro-emacs

The viewer 'less' has also Japanese localization whose latest version
is 2.3.7. It is offered as a patch for original less and its name is
less-237-iso2022-patch* or so.

[Kanji code] In UNIX machines, there are three major kinds of kanji
code: JIS, SJIS, EUC. JIS coding system, whose formal name is
iso-2022-jp, use only 7 bits so it is used for Internet news and mail
while SJIS (MS Kanji) is standard for PC and Mac. But it seems that
the standard of UNIX in Japan is EUC.

(In JIS coding system, there are some special escape sequences which
distinguish US-ASCII environment and that of kanji)

There are some kinds of kanji-code-converters, one of which is nkf
(Network Kanji Filter). Since Mule and NEmacs convert kanji-code of
input files to suitable one, so you don't care about kanji code if
you use only Mule and/or NEmacs (with correct settings).

[Japanese Mail and News on UNIX]
The easiest way is to install mule and use RMAIL and GNUS on mule for
Mail and News respectively. For settings, read Mule.FAQ, which is
distributed with mule.

If you like to read Japanese on mail and news with the same tool as
you are using now, such as MH, tin, rn or so, then you must get
Japanese localization of the tool and install it because original
tools can not understand escape sequences for JIS kanji-code, which is
used on Internet. The names of Japanese localization for MH and tin
are mh-6.8.3-JP* (mh_version-patch_level-JP) and ktin1.5-1.22*
(ktin-ktin_version-tin_version) respectively.

**Complement(Dirty trick)**
The above method is complete one to read mail and news. But there are
some 'incomplete' methods to read news:

1) For trn, try option '-j'.
2) For tin, use a Japanese viewer or editor as a filter. Just 'more'
   might work.

In both cases, you might be in trouble that your console become
confused on command line (all characters, including prompt, become
kanji)--a condition known as "moji-bake." The solutions are as follows:

a) If you are on kterm, then press [ctrl]+[middle mouse bottom]
   to pop up the menu of vt options and select 'Do full reset'.
b) If you are on Japanese terminal, try (in blind) 'reset [ctrl]+j'.
c) (All mighty) Try "echo '\033(B'", where 'echo' must understand
   the notations such as '\033'. 'echo' in System V machines will
   work in general (In SunOS 4.x, use /usr/5bin/echo while in
   Solaris 2.x, /usr/bin/echo works). Anyway, your terminal will
   be recovered if you send 3 charactors '033'(in octal; escape),'('
   and 'B' in this order.


[Japanese WWW browser on UNIX]
Netscape 2.0 and later supports Japanese under all platforms. Just
go to Document Encodings under the "Options" menu and pick your
favorite language encoding.

Mosaic has cjk (chinese-japanese-korean) localization whose archive
names are Mosaic-2.4-l10n-* or so. It is true that there are the
localization of Mosaic 2.[56], but I'm afraid that they are distributed
only in source codes. As you know, you need Motif in order to compile
Mosaic. But then again, who uses Mosaic these days?

On Emacs, there is a WWW client named w3, which is available also on
Mule (and NEmacs) and can display Japanese texts.

[Connection to UNIX from PC or Mac] You need a Japanese terminal
emulation program on PC or Mac, which is mentioned in (7.3.1) and
(7.3.2).

The points of setting up are as follows:

1. Check the setting of both your modem and the modem of a connecting
   UNIX machine. The parameters character size, parity, stop bit are
   important to communicate in Japanese kanji (2byte chars.), and
   the following setting is recommended:
   non parity, character size=8 and do not strip 8th bit.
   (In the words of UNIX stty: np, ms=cs8, -istrip)

2. If you have direct connection with a serial port, then just check 
   the setting of the serial port.

3. Check the setting of your terminal program.

4. If Character size is 7 and the setting can not be changed, then you
   can use only JIS kanji-code for communication between the machines.
   Make sure that your terminal program can handle JIS code.

5. If the setting recommended 1 is realized, then you can (and must)
   select suitable kanji-code among JIS, SJIS and EUC. Make sure which
   kanji-code your terminal program can handle.

User Contributions:

Comment about this article, ask questions, or add new information about this topic:

CAPTCHA




Top Document: soc.culture.japan FAQ [Monthly Posting] [3/3]
Previous Document: (7.3.2) Japanese on MS-DOS and Windows
Next Document: (7.4) Internet resources on Japan

Part1 - Part2 - Part3 - Single Page

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
shimpei@gol.com (Shimpei Yamashita)





Last Update March 27 2014 @ 02:11 PM