[[JapaneseEnvironment|(Japanese)]] [[OsamuAoki|Wiki links]] = Japanese Environment = I hereby describe methods to set up a Japanese environment in Debian. In order to set up 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. * Input method for Japanese * ibus and its family of packages: auto-installed packages for ibus-mozc is good choice * relogin to X * once everything is installed, set up ibus to use mozc as the input method via the GUI {{{ibus-setup}}} by adding Japanese from the Input Method menu with mozc as its method. * Japanese fonts * fonts-ipafont * fonts-vlgothic * Japanese messages * manpages-ja * manpages-ja-dev * libreoffice-l10n-ja * iceweasel-l10n-ja * kde-i18n-ja (required only when KDE is deployed) * Japanese documentations * doc-linux-ja-text * doc-linux-ja-html * Japanese related tools * lv * nkf * jfbterm  Read {{{/usr/share/doc/ibus/README.Debian.gz}}} in detail for input method.  Read Fonts/FontsProprietaryJapaneseFonts for more font hints == What is locale == The locale is used for LANG environment variable to define language environment. It has a structure of {{{xx_YY.ZZZZ}}} and has following meanings: || xx || [[http://en.wikipedia.org/wiki/ISO_639|language codes ]] || || yy || [[http://en.wikipedia.org/wiki/ISO_3166-3|country codes ]]  || || zzzz || encoding || 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: || UTF-8 || [[http://en.wikipedia.org/wiki/UTF-8|recent standard, multilingual compatibility]] || || eucJP || [[http://en.wikipedia.org/wiki/EUC-JP|old UNIX standard, only for Japanese]] || || Shift-JIS || [[http://en.wikipedia.org/wiki/Shift-jis|old Microsoft standard, only for Japanese]] || || ISO-2022-JP || [[http://en.wikipedia.org/wiki/ISO_2022|standard for Japanese e-mail, use only 7 bit code, only for Japanese]] || || ISO-8859-1 || [[http://en.wikipedia.org/wiki/ISO_8859|old standard for western European languages, ASCII+accented characters, 8 bit code]] || || ASCII || [[http://en.wikipedia.org/wiki/American_Standard_Code_for_Information_Interchange|US standard, 7 bit code]] Simply set LANG=C || These encodings are well thought out to keep them compatible within ASCII code ranges. If you accidentally haven't created the ja_JP.UTF-8 locale, please execute the following to enable Japanese UTF-8 environment. {{{ $ sudo dpkg-reconfigure locales }}} == Set up of language related environment variables == 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 {{{ LANG="ja_JP.UTF-8" }}} when Japanese is selected during the etch installation process under etch (as of December 2006). == Working with key programs == === emacs situation === * emacs is quite smart and copes well with many encoding systems. So please pay extra attention to it. * emacs has its own unique Japanese input infrastructure (egg etc.) which does not rely on external programs such as X nor FEP. * If you wish to input without going through XIM, set {{{XMODIFIERS}}} value to "none" while starting emacs. From shell, execute as: {{{ $ XMODIFIERS=none emacs }}} In order to adjust Debian menu, place customized configuration in {{{/etc/menu}}} following the method described in {{{/usr/share/doc/menu/html}}}. === vim situation === . vim is also quite smart and copes well with many encoding syatems. So please pay extra attention to it and basically try to use vim under UTF-8. No special input method configuration needed. Please refer to "Method to edit non-UTF-8 encoded text files under UTF-8 vim" [[UTF8vimE|(English)]] [[UTF8vim|(Japanese)]] == IBus == Recently [[http://code.google.com/p/ibus/|IBus]] has become the most widely used input framework - it's probably the best choice for Japanese input in Debian There are two Japanese IBus engines: {{{ibus-anthy}}} and {{{ibus-mozc}}}. {{{ibus-mozc}}} is an input method that originates from Google Japanese Input, while {{{ibus-anthy}}} is a more established method. It would be advisable to test both and pick the one that is the most appropriate for your needs. Run the following to install mozc: {{{ $ apt install ibus-mozc }}} and this to install anthy: {{{ $ apt install ibus-anthy }}}