Japanese Environment

I hereby describe methods to set up Japanese environment under Debian etch for your reference. (This should give good reference to other non-European languages.)

Each command is not explained here in detail. Please refer to the manpages.

<!> In order to setup and use not only Japanese environment but also multilingual environment smoothly, please select the locale with UTF-8 encoding.

Required packages for Japanese environment

Following lists required packages for Japanese environment.

== What is locale ==The best supported language region is U

The locale is used for LANG environment variable to define language environment. It has structureof xx_YY.ZZZZ and has following meanings:

The language region of Japan is ja_JP but if it is used alone it is treated as tradional ja_JP.eucJP . The language region of US (the best supported) is en_US but if it is used alone it is treated as tradional en_US.ISO8859-1.

For example, the encoding system often used for Japanese are:

These encodings are well thought out to keep them compatible within ASCII code ranges.

If you happen not to created ja_JP.UTF-8 locale, please execute followings to enable Japanese UTF-8 environment.

$ sudo dpkg-reconfigure locales

Each program behaves differently depending on the set up of language related environment variables.

Here, you have to pay attention to the fact that some program uses PAM (pluggable Authentification Module) and the environment variable set by PAM has priority.

Both /etc/environment and /etc/defaults/locale files define


when Japanese is selected during the etch installation processunder etch (as of December 2006).

Under normal X environment, this is OK with me. But I do not like to use Japanese for console session after system crash or for su session. For such session, I like most robust environment for console thus I set LANG definition for them as:


There may be a way to work around this problem using kon2 or frame buffer console. This is purely my taste issue.

But this will make gdm to be in English. (X session itself can be set to Japanese from gdm menu.)

I use PAM to start gdm with Japanese menu as follows. First Let's change the following line defining language environment variable in /etc/pam.d/gdm or /etc/pam.d/gdm-autologin (the actual file depends on display manager and its setup):

auth    required        pam_env.so read_env=1 envfile=/etc/default/locale


auth    required        pam_env.so read_env=1 envfile=/etc/default/locale-gdm

.Then create a file /etc/defaults/locale-gdm containing:


.Then GDM becomes Japanese. Actual language (value for LANG) can be set through GDM menu. So you can still use English environment in X.

Setup of Japanese input in Debian

Setup of Japanese input in Debian is simplified by using im-switch.

For complicated setups specific to the each Japanese input method is best handled by the accompanying GUI configuration tool for each input method. For these configuration tools can be activated by clicking icon for the setup in the toolbar of Japanese input methods or clicking configuration tool icon on Gnome toolbar as [Desktop] -> [Configuration].

First you install im-switch and one of the Japanese input tool chain packages, uim or scim.

For the detail of setup, see /usr/share/doc/im-switch/README.Debian.gz, /usr/share/doc/scim/README.Debian.gz or /usr/share/doc/uim/README.Debian.gz. Here key points are described.

<!> im-switch command behaves differently if command is executed from root or not.

$ cd ~/.xinput.d
$ ls -l
lrwxrwxrwx 1 osamu osamu 28 2006-11-25 00:50 ja_JP -> /etc/X11/xinit/xinput.d/scim
$ cat ja_JP | sed 's/XIM_PROGRAM=.*/XIM_PROGRAM=/;s/XIM_ARGS=.*/XIM_ARGS=/'>ja.JP.file
$ mv ja.JP.file ja.JP

The variation of above UIM configuration to register start of UIM to the session manager is to start UIM as toolbar from shell as "uim-toolbar-gtk >/dev/null 2>dev/null &" and let it get auto registered to start upon restart. (I did not test if the delayed start of it after stabilizing uim-xim.)

In above, toolbar is started without relying on session manager. In order to prevent duplicate toolbars to be started upon relogin, you may register s * Relogin to user's account and refresh X session. ession manager not to (re)start "uim-toolbar-gtk".

Japanese input in console can be enabled by uim-fep package. (I am not familiar with jfbterm which enables Japanese display in console.) UIM has a merit in this functionarity.

<!> Input method started by im-switch depends on the value of locale.

<!> Japanese input method may be started under English environment using im-switch. It is quite useful to have Japanese input method under en_US.UTF-8 environment.

<!> In order to start SCIM under non-CJK locale, you need to add list of those locales to ~/.scim/global or /etc/scim/global :

/SupportedUnicodeLocales = en_US.UTF-8,en_GB.UTF_8,fr_FR.UTF-8

<!> Some people may think setting new immodule machanism to the GTK_IM_MODULE variable, but currently setting it to xim seems to be most stable environment by experience. It is discussed under /usr/share/doc/scim/README.Debian.gz in detail.

Working with key programs

emacs situation

$ XMODIFIERS=none emacs

In order to adjust Debian menu, place customized configuration in /etc/menu following method described in /usr/share/doc/menu/html.

vim situation