Using Japanese on NetBSD


WARNING: The information in this page is grossly out-dated. I will leave the pages up in case they might be of some use.

NOTE: I have not used NetBSD for more than 3 years! I have not used MacOS or Mac hardware in more than 5 years. Please see a more up to date website rather than e-mailing me.


BSD Daemon
This brief document discusses how I got Japanese working on my NetBSD/mac68k UN*X system. There are probably others ways to accomplish the same end result. In the end, I built my system using KTerm, Wnn4, Kinput2, and jvim. Since I am a vi person, I chose jvim as my editor. The same system should work with mule.
Coming Soon! This page in Japanese.

Step One: Displaying Japanese

My first goal was to be able to display Japanese on my NetBSD system. Since the X Window System includes Japanese fonts, all you need is KTerm, an XTerm substitute that is capable of displaying different character sets. In my search, I came across an interesting site: http://www.axe-inc.co.jp. This site includes the Install Guide for NetBSD version 1.1 in Japanese, as well as some pre-compiled binaries. I downloaded KTerm from their ftp site.

NetBSD still does not have the locale system implemented like FreeBSD or Linux. So when you run the command kterm & you will probably get an error message like:

Couldn't set locale: ja_JP.eucJP,ja_JP.ujis,ja_JP.EUC,japanese.euc,Japanese-EUC,ja,japan

I have not had any problems using KTerm even though I always get that warning. At some point, I am going to try to implement the locale system for NetBSD based on the FreeBSD version.

Once you have a Japanese-capable terminal program, you still find that many programs will not display Japanese properly. If you use cat, it displays Japanese but if you use more or less it does not. Unless the docuemnt is very short, when you use cat, you lose the top of the text. So you have to be creative with head or tail. The same ftp site that included KTerm, also included a patched version of less that is supposed to display Japanese in KTerm. I installed it, but it never displayed Japanese properly for me.

However, from the same site, I did download a program called Ng. Ng is an emacs clone that is Japanese-capable. I am not used to emacs, but I was able to get it to display long Japanese documents without too much trouble. The problems with Ng are that it include absolutely no documentation and that it does not always follow "standard" emacs commands.

Download KTerm 6.20 (74k)
Download Ng 1.3 (60k)
Download Less with ISO patch (130k)

Step Two: Setting up A Kanji Server

If you want to input Japanese of your own, you need three things: a Kanji server, a front-end processor (FEP), and a Japanese-capable text editing program.

According to my research, there are three Kanji servers: Wnn, SJ, and Canna. Canna seems to be common among Linux users. I chose Wnn because I found it already compiled at the Axe ftp site. Once you install Wnn, then all you need to do is set it to start up automatically. I made the following entry in /etc/rc.local

# Start Wnn Kanji Server
if [ -f /usr/local/bin/Wnn4/jserver ]; then
/usr/local/bin/Wnn4/jserver -s /var/log/wnn-log
fi

Basically, then Wnn runs in the background. You can set up a single Kanji server on a LAN and have other workstations access it remotely if desired.

Download Wnn4 (1.2M)

Step Three: Setting up a Front-End Processor (FEP)

Once your Kanji server is setup, the next thing you need is an FEP. In the MacOS world, KanjiTalk comes with the Kotoeri FEP. You can also get ATOK which is available for MacOS, Windows, and some flavors of UN*X. The Wnn package includes an FEP called uum. Ng is supposed to work with uum, but I could never get uum to start up. It always gave me an error message to the effect that my "terminal was not strong enough." Now there's a helpful error message!

My research indicated that Kinput2 was the FEP of choice, so I downloaded the source for Kinput2. Getting it to compile properly was a bit of a struggle (mostly because I am not very familiar with the use of make), but in the end I got a working copy. I had a difficult time getting the -lcrypt option in at compile time. Here are some tricks to get it to compile:

Next you need to set some environment variables. You need to specify a JSERVER so Kinput2 can find your Kanji server. On a stand alone system, it will be localhost, but on a network it will be the hostname of the server running Wnn. You also need to set the XMODIFIERS environment variable so that X knows you are using Kinput2 as your input method. I use C shell, so I have added the following two lines to my .cshrc:

setenv JSERVER localhost
setenv XMODIFIERS "@im=kinput2"

With Kinput2 installed, I thought that I was ready to go. But I found out that you need to adjust up your KTerm settings to use Kinput2. In my .Xresources file, I added the following settings for KTerm:

KTerm*VT100.Translations: #override \
Shift space: begin-conversion(_JAPANESE_CONVERSION) \n\
Shift Prior:scroll-back(1,line) \n\
Shift Next:scroll-forw(1,line) \n\
NonePrior:scroll-back(1,page) \n\
NoneNext:scroll-forw(1,page) \n\
NoneInsert: insert-selection(PRIMARY, CUT_BUFFERO)

Once KTerm is setup, you can switch back and forth between Japanese and normal input modes. I am used to the MacOS Kotoeri FEP and I have used the Micro$oft FEP that comes with Windoze as well. Of course, Kinput2 is completely different, so I have to unlearn my Kotoeri habits. Gradually, I am becoming used to it and now I rarely need to use MacOS anymore. Since Kinput2 is a pain to compile, I will make a binary package and put it here for downloading someday soon.

Download Kinput2 (186k)

Step Four: Inputting Japanese

With both Wnn and Kinput2 fired up, you are ready to input Japanese. At first, I tried using Ng, but it is apparently incompatible with Kinput2. Actually, this is fine with me, since I am a vi person. I ran across jvim (a Japanese-capable vi clone). It compiled without any problem, but for your reference, here is my Makefile. Now all I need to do to input Japanese is start jvim and hit SHIFT-SPACE.

Incidentally, I use Pine as my e-mail program and the pico editor appears to take the Kanji input but it gets mangled. I have set jvim and my alternate editor in Pine. Pine will display Japanese properly if you run it in a KTerm and set the Character Set to ISO-2022-JP in the Pine configuration. I can read Japanese e-mail and also the fj.* and other Japanese Usenet newsgroups in Pine.

If you want to be able to enter Japanese into your shell, you will need to get tcsh, which is also available from the Axe FTP site. I tried it and it works, but I don't really need it, so I still use csh. Although it compiles quite easily, I have made up a binary package for jvim and it is available for download.

Download Jvim (153k)
Download Tcsh (210k)

Step Five: Putting It All Together

Screenshot of KTerm and Jvim

In the screenshot above, I am using jvim to edit a text file. When I want to insert Japanese, I press SHIFT-SPACE and I go into Japanese input mode (basically Kinput2 kicks in). As you can see, Kinput2 presents a nice window of possible Kanji for a selection.

In the future, I would like to be able to add Japanese ability to Internet programs. Pine works fine for e-mail and Usenet news. However, I also want to be able to read Japanese homepages using jlynx. For now, I am running Netscape off of an Intel machine so I can view Japanese pages.


Important Links and Information

Japanese NetBSD/mac68k Documents
Japanese translation of the Installation Documents for NetBSD version 1.2 by Ken Nakata.

Yukikazu Tsuchiya's Page of MacBSD Links
This page conatisn several links to pages in Japanese regarding MacBSD.

Install Guide for NetBSD/mac68k version 1.1
Japanese translation of the Installation Documents for NetBSD version 1.1. It also includes a section on setting up an MO drive and setting up Japanese.

NetBSD on MacIIvx
A page in Japanese I found that describes running NetBSD on a Macintosh IIvx .

Usenet Newsgroup fj.os.bsd.netbsd
This is the Usenet newsgroup in Japanese for NetBSD. I have found the information here to be rather useful. The people who frequent this newsgroup are very helpful.


Go Back
Back to my MacBSD page.


Last updated, 2003-02-13.

This page and all pages in this site are Copyright 1997-98 by Mark Andres. All right reserved.

URL for this page: http://www2.giganet.net/~mark/NetBSD/japanese.html