CJK Support on CSAIL Debian

This page documents support for the viewing and input of Chinese, Japanese, and Korean (CJK) language in CSAIL Debian. If you just want to view CJK on the web, install the following packages:
ttf-arphic*   (Chinese)
ttf-unfonts   (Korean)
ttf-alee      (Korean)
ttf-baekmuk   (Korean)
ttf-sazanami* (Japanese)
ttf-kochi*    (Japanese)
Not all of those fonts are necessary, but they should give you a decent selection. Then add the following line to /etc/X11/XF86Config-4:
FontPath        "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
Now restart X and you should be able to view most Chinese, Japanese, or Korean webpages. To change fonts for those languages, go to Edit->Preferences->Fonts and Colors in Mozilla and you should see the fonts you just added. If you also want to input text, please follow the instructions below.

Installing/Configuring Locales

First, install the locales package (newer installations should have this. If the output of `dpkg -l locales` contains something like "=ii locales ...=" then it is installed, in which case run sudo dpkg-reconfigure locales to reconfigure it and follow the instructions below.) You will be prompted to choose which locales to generate. You'll probably want at least the following:


You will then be asked which locale will be used as a default (probably en_US). After this, you should see output showing the various locales you selected being generated.

Installing Fonts and Input Server

Next, install the following packages:

ttf-arphic-bsmi00lp -- big5
ttf-arphic-gbsn00lp -- gb2312

You will also want to add the following line to /etc/X11/XF86Config-4 and then restart X.
FontPath        "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
This will allow various X utilities to use the new fonts you've installed. At this point, you should be able to view Chinese, Japanese, or Korean text on most webpages.

Entering Text

To input text, scim will need to be running. Start scim in daemon mode with
$ scim -d

Now set the following environment variables (case is important here):
$ export LC_CTYPE=zh_CN
$ export XMODIFIERS=@im=SCIM

and for csh variants:
> setenv LC_CTYPE zh_CN
> setenv XMODIFIERS @im=SCIM

For Korean and Japanese use ko_KR, and ja_JP for LC_CTYPE. If you use more than one language, you can either use separate terminals with different environment variables, or just set LC_CTYPE to en_US.UTF-8 and in the scim control panel choose which input method to use.

Now start your app. For text editors, konsole seems to work well for all languages. You can also try crxvt-big for Traditional Chinese, crxvt-gb for Simplified Chinese and krxvt for Japanese.

To start entering text in your chosen language, type 'Ctrl-Space'. You should see a control panel for scim pop up. You can select your input method by clicking on the panel. You can have different windows using different languages and input methods. SCIM selects which method to present to you by checking the environment variable $LC_CTYPE (or $LC_ALL or $LANG if you want). For more information on using scim, check out:
www.scim-im.org and


With emacs, goto Options->Mule->Set Language Environment and choose your language. Ctrl-'\' will toggle input modes between your default language and your selected one.


With Netscape/Mozilla: for some reason, they don't like the en_US.UTF-8 locale, so you'll need to set LC_CTYPE to something else (zh_CN.UTF-8, ko_KR.UTF-8, or ja_JP.UTF-8).

-- BrianJones - 01 Jun 2005
Topic revision: 20 Nov 2006, JasonDorfman

MIT Computer Science and Artificial Intelligence Laboratory


  • About CSAIL
  • Research
  • News + Events
  • Resources
  • People

This site is powered by Foswiki MIT: Massachusetts Institute of Technology