Ficorp Home PageSite Map (not currently available)E-Mail Ficorp
Ficorp Logo
Ficorp Home Page
About us
Feedback and Guest Book
About software localization
Links
Site map

Tips for Linux Internationalization (i18n) or how to handle Asian text in Linux

Introduction

The purpose of this document is to show how to view Asian and other non-English characters on Linux and Unix.

Examples are given for the following configuration:

  • Operating system (server): RedHat Linux 8.0
  • Operating system (client): Windows 2000
  • Language: Simplified Chinese

Conclusions and solutions in this document can be generalized as follows:

  • Conclusions regarding Linux are valid, with minor modifications, for other releases of Linux.
  • Windows references apply to Windows XP (and to a lesser degree to Windows NT) as well as Windows 2000.
  • Finally, the language issues apply to any language that does not use pure Roman script (with the possible exception of bi-directional languages like Arabic and Hebrew).

Client or server?

When working with Linux, there are two ways to access Asian characters:

  • On the Linux box itself
  • Over a terminal emulator on a Windows machine

Using Netscape (Mozilla)

The easiest way to view Asian text on Linux or Unix is to with Netscape.

Here are the steps:

  1. To open a web page (.html, .htm), simply double-click on the page or drag it to Netscape. For other files, use File->Open. For example, let's open a Microsoft glossary file in comma separated text (.csv) format.
  2. If the file displays correctly, you are done. If not, set the character encoding as shown in the following screen shot:

    The same characters may be stored in UTF-8, in which case you will need to use the Unicode (UTF-8) setting.

  3. The resulting text will be displayed correctly, as shown below:

Terminal mode in Linux

Note: the first step applies only to RedHat Linux 8.0 and perhaps earlier releases of RedHat Linux. The remainder of this section applies more generally.

Selecting the default language

Select your default language by opening the Language Selection application as root (System Settings --> Language in the KDE or execute redhat-config-language).

The following dialog will appear:

If you see the language you want, simply set that language and skip to Test it. If not, read on!

Adding language support after installation

If you see only "English (USA)" or some other language, but not the Asian language you want to display, you will need to add language support.

For RedHat Linux, language support is part of the Linux installation process. There is a nice dialog in the installation program that lets you add languages, but you will not be able to add them later using the installation program, "anaconda". I tried installing an update, but there was no option to add languages.

Here are the steps that I went through to add Chinese and Japanese support:

  1. Add the language RPM's. These can be found on disk 3 of the RedHat distribution, or anywhere on the net. For Chinese, I installed kde-i18n-Chinese-Big5-3.0.3-1.noarch.rpm. As the name implies, this affects the KDE desktop, so it may not be necessary in general.
  2. Create or edit ˜/.i18n to give you an English interface but Chinese support (the following points thanks to www.cis.upenn.edu/~maoy/faqs/linux.html)
    LC_CTYPE="zh_CN.GB18030"
    LC_NUMERIC="en_US.UTF-8"
    LC_TIME="en_US.UTF-8"
    LC_COLLATE="en_US.UTF-8"
    LC_MONETARY="en_US.UTF-8"
    LC_MESSAGES="en_US.UTF-8"
    LC_PAPER="en_US.UTF-8"
    LC_NAME="en_US.UTF-8"
    LC_ADDRESS="en_US.UTF-8"
    LC_TELEPHONE="en_US.UTF-8"
    LC_MEASUREMENT="en_US.UTF-8"
    LC_IDENTIFICATION="en_US.UTF-8"
  3. Change /etc/sysconfig/i18n as follows:
    LANG="zh_CN.GB18030" 
    SUPPORTED="zh_HK.UTF-8:zh_HK:zh:zh_CN.GB18030:zh_CN:zh:zh_TW.Big5:zh_TW:zh:en_US.UTF-8:en_US:en"
    SYSFONT="lat0-sun16"
    SYSFONTACM="iso15"
    

    Note: RedHat recommends a different SYSFONT setting in their release notes. "On the console, the latarcyrheb‑sun16 font is used for best Unicode coverage. Due to the use of this font, bold colors are not available."

    You can modifiy this for other languages such as Japanese or Korean (or Russian, for that matter).

  4. Select the default language, as shown above
  5. Log off and back on
Test it

Try out an xterm with some Chinese text.

The following screen is a display of a Microsoft glossary for Simplified Chinese, encoded in GB2312.

The setting for $LANG is zh_CN.GB18030, and the program shown is vi.

Terminal emulation

One of the ways to deal with any data held on a Linux or Unix server is through terminal emulation on Windows.

All you need is a good terminal emulator, one which handles Asian characters and which supports various fonts and scripts.

NetTerm

One very nice terminal emulator that supports Asian characters is NetTerm.

Here is a simple setup for connecting to Linux as an Xterm:

  1. Start the program, and select File --> Phone directory. Set up the IP address, terminal type, and a name for this emulation.

    For an example, see the following dialog:

  2. Select Add to save the emulation description in the phone book.
  3. Click on the font button.

    The following dialog shows a setting for Chinese with white characters (default is a funky lime color):

  4. You will now be able to view Chinese text, as shown below:

Hummingbird eXceed

Preliminary notes

By default, eXceed does not install Asian fonts. They can be added by choosing the "Custom" installation option, and re-installing if necessary.

Strangely, the option to set up Asian fonts is labelled "Japanese". If you select Japanese, a later dialog offers Chinese and Korean fonts as well.

If you installed using default settings, you can re-install, and choose the Asian fonts.

cxterm

To view Chinese, you may need to install cxterm. This is a version of xterm that supports Chinese as well as Japanese and Korean. The version I found was cxterm-5.1p1-2.i386.rpm (search on that in Google).

This version of cxterm comes with Big-5 fonts only, because other Asian fonts are delivered with RedHat. cxterm can run Japanese, Korean, and GB formats too, though I only tested Big-5.

The concept of cxterm is different from NetTerm, which is a terminal emulator running on Windows. cxterm runs on the Linux (or Unix) box and runs like any other X-Windows program.

Here is a screen shot of cxterm running with default settings on Windows:

If you don't like the small white-on-black setup, you can change it as follows:
cxterm -fg black -bg white
or...
cxterm -fg green -bg yellow

Conclusion

Dislaying and working with Asian fonts can be done very nicely on Linux. This applies to:

  • Native Linux applications
  • Windows terminal emulation
  • X-Windows emulation using Exceed

Your comments are always welcome. Simply visit our Guestbook

    © 2008 Ficorp,  Inc.   All rights reserved. Home    About Us    Services    Contact Us