Despite my belief going into the ordeal, Debian (GNU/)Linux can in fact be configured to accept Japanese language input with just a little effort. After taking a stroll around ye olde interwebnet, I found a bunch of documents dealing primarily with the RedHat or Mandrake distributions. I've gathered this information here in hope that it might be useful to someone else. The following is a condensed version of the random HOWTOs I read:

Before doing anything else, you first need to have the locales Debian package installed. When dpkg is configuring the software, it will ask you what locales you want to build support for. You'll want to tell it the following:

  • en_US ISO-8859-1
  • en_US.UTF-8 UTF-8
  • ja_JP.UTF-8 UTF-8

These locales will then be automagically generated for you, such that you may use a non-English language with your newfangled lunix.

Now, if you just want to use Japanese input for a little bit, you should be able to just export LANG="ja_JP.EUC-JP" then run emacs or whatever you need to work on. If you want a more permanent solution, you can add that data to your ~/.xinitrc or ~/.Xsession (depending on what distribution you are using).

Next you just need to add the following to the same configuration file, and the process is almost complete:

  • export XMODIFIERS="@im=kinput2"
  • kinput2 -canna &

Now, for some ~/.Xdefaults settings:

  • *.inputMethod: kinput2
  • *.preeditType: OverTheSpot
  • Kinput2*useOverrideShellForMode: true
  • Kinput2*conversionStartKeys: Shiftspace
  • KTerm*VT100*KanjiMode: euc
  • rxvt*multichar_encoding: eucj

Once you've completed these steps, you can either xrdb ~/.Xdefaults and set the environment variables by hand, or restart X. Voila, things are golden. With Debian, you'll want to use ctrl-o to enter kana input mode (a little a hiragana character will pop up), then type, then hit ctrl-o again to exit. I found that with emacs, you'll need to use the shift-space combination to activate/deactivate kana input mode. Happy inputting!


Update: Japanese TrueType fonts are a bit difficult to find. You might want to get a copy of Microsoft's MS Gothic and MS Mincho fonts and add them to the appropriate font path. For Debian users, you can install the xfonts-naga10, ttf-kochi-mincho-naga10, ttf-kochi-gothic-naga10, xfonts-intl-japanese, ttf-xtt-wadalab-gothic and ttf-xtt-watanabe-mincho packages, or a combination of the above.
Update, 10 December 2002: I found out today while doing some java homework that if you have your LC_COLLATE and LC_CTYPE variables set to ja_JP.EUC-JP as one of the source pages indicates is handy, when you use javac, all your warning and error output will be in Japanese. Easiest fix is to just set both those variables to en_US in the term you're working in, and try again. With those variables reset, your output will be back to normal. Furthermore, you might get a bunch of XIM warnings from the JRE if you use Sun's JRE with your environment variables set to their Japanese versions.