HOWTO read/write Japanese email on Debian systems

This gives a brief HOWTO on reading and writing Japanese on Debian GNU/Linux machines. Some of the info should be applicable to non-Debian systems.


Necessary Packages

This is the only section where you need root.

Use `apt-get' to install the following Debian packages. You can probably use dpkg or dselect or other Debian package managers that are becoming available, but I used apt-get which takes care of many of the dependencies for you. If you use others (such as raw dpkg) the dependencies may need to be satisfied (of course Debian won't actually let you install packages with broken dependencies so you won't mess up your system. You will just have to get hold of all the necessary debs first). Using dselect+ftp should work well also (if you can stand dselect).

Conectivity requirements

To compose Japanese with mule (xemacs21 with mule support) you can run it either as an Xapp or inside a kterm.

Starting Kterm

Either on the local machine or on the machine on which you wish to read email, start kterm using the command:
	kterm -km sjis &
This will start kterm using the `sjis' kanji mode. You only need this option if you intened to use mule inside the kterm.

Pine setup

To use `mule' as the editor in Pine, from the main menu do (S)etup, (C)onfig and enable: enable-alternate-editor-cmd and enable-alternate-editor-implicitly (this last is optional. If you don't enable it implicitly you must explicitly type C-_ to start the editor). Also set character-set to ``iso-2022-jp'' and editor to ``mule'' (if you made the symlink as I did above, otherwise, set it to ``xemacs-21.1.10-mule-canna-wnn'' or however the current Debian xemacs-mule package gets installed into /usr/bin. You can look at /usr/local/bin/mule to see if the symlink is in place.)

Reading mail

To read Japanese mail, just start pine in a kterm and read as usual.

You can also read Japanese text outside of pine by using

	less -r [file]
inside a kterm.

Writing mail

If you wish to have pine start mule as an Xapp then set your DISPLAY variable to point to whatever X display you are sitting at. This may not be necessary, for example if you use `ssh' with X forwarding turned on (ssh -X). If your DISPLAY is correctly set, then mule will open as an Xapp. If you want to force mule to stay inside the kterm, then either unset your DISPLAY variable or use `mule -nw' as you editor instead of just `mule'.

To write Japanese mail, start composing in Pine as usual, then either implicitly start mule by moveing below the headers in Pine's compose window, or explicitly by hitting ^_ (control-underscore).

When mule starts up, hit C-\ (control-backslash). You will be prompted for an ``Input method''. Use ``japanese-canna''. Then enter Japanese by type by entering romanji and using space-bar and arrow keys to find which kanji you want. Hit enter when satisfied or C-g a few times to cancel. After hitting enter the fences (``|...|'') will disappear. Also, when you enter romanji, it will be translated to hiragana. If you hit the down arrow just after the hiragana shows up you will get katakana. You may need to do `M-x setup-japanese-canna' to get the fonts looking right. If this is necessary, you can put `(setup-japanese-canna)' in your .emacs file to make this default.

After finishing the composing exit mule as normal (C-x C-c y) and the message will be put into Pine's ``Message Text'' buffer. It will look like garbage line noise because Pine doesn't seem to know what type of encodeing this is (maybe a pico problem). If anyone knows the solution to this, please email me. But, it is actually okay (mail yourself a few test emails to check it).

Finally do C-x to send as usual.


You need to install the fonts needed to render Japanese characters onto your X server not client (the server is the machine you are sitting at). I generally just install as many Japanese related font packages as I see. In Debian's ``potato'' distribution I installed: It is also possible to get fonts from a font server (something running xfs). If you have access to such a server then you can tell your X server to get it's fonts from the font server by issuing the following command:
xset fp+ tcp/server:port/catalog
see below for local example. When you first load fonts it can take a while and it may appear that the system is hung. Just be patient.

Locally installed programs.

To read/write Japanese email on our SUNY SuperK machines you can do so on ale via something like:
  1. myhost> ssh ale
  2. ale> kterm -km sjis &
  3. kterm@ale> pine
To use ale as a font server type the following line in an xterm, or add to your .xinitrc file:
xset fp+ tcp/
Finally, configure your Pine as above and you should be all set.


Please notify me of any problems or if there is something here which is wrong or unclear.
Last modified: Thu Jul 13 10:57:43 EDT 2000