How to configure an English Japanese capable Debian.

This howto is a step by step guide to configure a working Debian english system, with the capability of displaying AND writing japanese. I gathered information from various sources (see at the end of the document) that already wrote on the issue and tried succesfully to get such a system working but, as far as I know, none of them is complete. Therefore, this document is aimed at giving all the clues to properly set up  a japanese capable english operating system.

Notes: Since english isn't my native language, please apologize for my bad english. Any help on that matter is most welcome. Besides, if you want to add some information, such as "French japanese capable OS" or "Russian japanese capable OS", just go ahead and send me an email: I'll be pleased to add such information. Adding specific information about other distributions is appreciated, too.

Note: I installed the Etch pre release version, and all this document is about Etch (more or less). If you want some informations for woody or sarge, please see the version 1.1 of this document.

1.Packages installation

You need a bunch of package to be able to use japanese (from Debian Reference):
I might have forgotten some packages, feel free to mail me if you notice something is missing

Since I'm familiar with canna and kinput2, I suggest you use it, too.

2. Locales installation

You must add to your system the proper locales:
You may need some older ISO charsets if you use old softwares which still don't understand UTF-8.

To do this, just type dpkg-reconfigure locales and follow the instructions. The tool will generate all the locale you checked in.

3. User local configuration

Please be aware that japanese is not possible on purely console mode, unless you have an advanced text mode AND a special software.
My goal is to set up the japanese under X so this part won't be in this document.
You'll need to use the set-language-env script. Select the "8 : ja  (Nihongo,Japanese)" and answer all questions default (it is written in japanese and I'm not able to translate it)
The set-language-env script will modify your .bashrc, .bash_profile and .xsession files. The system is quite clever:
This system is very useful to Japanese speaking users,but it is not suitable for English speaking users who need a system which responds in english, not in japanese. Besides, if the terminal you use to launch X with startx isn't japanese capable, your X Window session won't be as well.

So you need to change a few things.
add this at the start of your .xsession, just after the line:

export LANG
#force EN menu and error displaying
You'll still have Japanese locales ON, but all the common display will be in english.

4. *dm tuning

It should work out of the box this the .xsession is the only change you must make.

5. Startx and X tuning.

If you prefer use startx, just do this: edit your .xinitrc file and add this, just before window manager.
# Start Japanese environment
export LANG=ja_JP.UTF-8
# Start Japanese input
kinput2 -xim -kinput -canna &
xmodmap -e 'keycode 115 = Kanji'
[window manager - mine is fvwm2]
All the locales will be set to japanese but, to  keep the English menu, we add LANGUAGE set up to en_US locale. You can probably use your own locale as well (such as French) but you may have some problems with accents and kanji - it must work perfectly with the UTF-8 charset.
At this stage, we launch the kinput2 software which can handle japanese entry, and we add the left Windows Key as "Kanji Key". The default {Shift space} remains, but since the Windows key is unused...

List of the Windows Keys codes.
left Windows key: 115
right Windows key  : 116
right Window menu key : 117

Note: I tried to do the same with the Default Gnome's Window Manager but the Windows Keys seem to be redesigned for the WM itself.
In this case, the [kanji key] is SHIFT SPACE only.

6. fvwm2 tuning

Well, it's not really tuning, but the font in the configuration sample files aren't japanese capable, so you need to change them. I suggest -misc-fixed-*-*-*-*-14-*-*-*-*-*-*-* instead, which is quite similar.
You may notice that the japanese isn't properly handled in the FvwmPager, and I still don't know why.

7. Others window managers

If you use the default gnome WM, it must work out of the box.

8. X software

If everything goes smooth, you must be able to launch your favorite software with japanese writing enabled.
Note: if you launch it from a xterm, it will not work! You need to launch it from the fvwm2 menu.
a. Terminal.
To test if it works, launch a kterm or a krxvt and type this:
ga[kanji key]ga[enter]
You must get this:

If you've followed this document, [kanji key] must be {Shift space} or the left Windows key.

The basic use of kinput2 is quite simple.
Please notice you can't hit the kanji key in hiragana mode, or you'll loose what you're typing. I suggest you hit enter at each Japanese word to avoid mistakes.
For basic information about LaTeX, please go to the main website.
CJK stands for Chinese Japanese Korean. We'll see here how to use LaTeX to write Japanese.
After installing the cjk-latex package, don't forget to run texconfig in the root account to have all stuff OK.
Then, to start a Japanese text, type this before:
and \end{CJK*} at the end.
Please notice you might have some errors if you use XEmacs (never try with emacs): XEmacs is often puzzled with charset, and especially with Japanese ones. Try using vim instead.
Besides, using accents in a CJK section coded in JIS, EUC or SJIS will make some odd things. I've never tried the UTF8 subsystem, though. Anyway, I think - at this time - the most standard is to use a JIS/EUC charset and forge the accents, like \'e instead of é.

To test if LaTeX works, feel free to download this example. It's one of my japanese texts I've made for my japanese course (I'd learning japanese): This is BAD japanese (very bad) but there is useful CJK commands in it, and basics cases are shown. Please refer to /usr/share/doc/cjk-latex/commands.doc.gz and /usr/share/doc/cjk-latex/ruby.doc.gz for details.

c.Various X softwares
Here are some others examples:


You  can download the 2.1 version at It's a free download.

OOo needs some Asian languages tuning: Go to Tools -> Options

At the first launch, "Searching in" and "Asian Layout" may not be displayed. You must first check "Asian languages support", select "Japanese" in "Default languages for documents" and click OK.
Then, you MUST see "Searching in" and "Asian Layout".

After that, go to "Text document" and "Basic Fonts" (both): you must set up the proper default font for English (first one) AND japanese. I suggest you  use the "Mincho" font.

There is a special issue about OOo: The Japanese isn't properly handled by the default UI font, so you will have something like this:

Yeah, quite ugly.
Here comes the hint (Thanks to Takamichi Akiyama from

You need to TYPE "Andale Sans UI" in the "Font" field even if the font is not in the listbox.
Use Mincho in the "Replace with" listbox under Linux, and "MS Mincho" under Windows XP.

And you will have this:

You can see that both the window manager (fvwm2) and OpenOffice fully understand japanese. We've done it!

Please note that this hint works under Windows XP.

You can test your OOo configuration with this file, which is the OOo file in the latest screenshot.

Note: To make furigana in the 1.1 version, select the kanji and pull down "Format -> ruby": you will be able to add furigana in your text like the latest example.
In the 2.X version, please use "Format -> Asian phonetic guide"

10. Printing.

Not tested at this time. please get back for the 1.3 version which must be released soon.
Although the printing with OpenOffice works perfectly well, it won't work with Mozilla.

I still haven't found a way to directly print with mozilla.

By the way, you can use PS file output, and I've done some test with the PS conversion, and the result depends on the page charset and default charset you use.
When the PS file looks good on your system, use ps2ps to force the Japanese font, and print the resulted file. It MUST work.

For plain text, I've found one way, but need to pass through a2psj and ps2ps, so I've made a very simple bash script:

#Small script to print japanese text on printer.
#Usage: lprj [text file] [-P[printer]]
FILE=`echo $USER`-`date +%s`.ps

a2psj $1 >/tmp/$FILE
ps2ps /tmp/$FILE - |lpr $2

There are probably plenty of better methods, mail me if you have something better (wonder if I must mind deleting the tmp file)

This is the end.

And you must have a quite useful Japanese capable english operating system.
Feel free to mail me (text only email) if you want to add something, comment or anything.

References and usefull links.

If you have made some similar document about another distribution, feel free to mail me, I'll be glad to add it.
I use all of this documents to make mine, it may be useful for others.

Debian: Basic japanese configuration under Debian (Osamu Aoki - EN) .
Debian: Some usefull hints (debian ML - EN).
Debian: How to set up pine/pico in japanese (JWS - EN).

Mozilla/Kinput2: Default key for kinput2 under mozilla (Katsuhiko Momoi - EN).
Mozilla/X:  Use of xmodmap, use of xinitrc (laeren - EN).
X tuning: Some clues about xmodmap (various - FR).
Gnome: Prise en charge du japonais sous debian (Charles Plessy -  FR)

OOo: Basic use (Jim Breen - EN).
OOo: Figure out which debian fonts I need (Noriaki Sato - JP).
OOo: I've found the hint but Takamichi Akiyama told me the way to make it (OOo - EN).
OOo: Good way to find out which font on your system is japanese capable under OOo ( - JP).
OOo: How to configure furigana (OOo - EN).


January, 6th 2007: Version 1.2

August, 15 2004: Version 1.1
May, 30 2004. Version 1:

Back to index.

Guillaume "LoneWolf" Estival.