This document contains frequently asked questions about Japanese language support in the Solaris(TM) Operating Environment. If you have questions or comments about this article, or would like answers to other Japanese language support questions, please submit them at http://developers.sun.com/contact/feedback.
- How do I print Japanese text files on a non-Japanese PostScript printer from a system that doesn't have Japanese locales installed?
- How do I view Japanese text if I'm not running a Japanese locale?
- Can I input Japanese characters only when running a Japanese locale?
- Can I display a document with Japanese characters in Netscape if all locales are installed on my system and I log in to the C locale? Do I have to set my font path? If so, how?
- What are the differences between the partial and full Japanese locales?
- How do I install Japanese locales after the Solaris OS has been installed?
- Does the isspace macro work with Asian locales?
- When a user logs in to a Japanese locale, what happens behind the scenes? At what point are Japanese characters displayed?
- Can user accounts, files, and directories be named using multibyte characters (such as Kanji and Chinese) instead of ASCII? To what extent does Solaris support MBCS (multibyte character sets)?
- How do I change Japanese input modes on Type 5 and Type 6 keyboards?
1. How do I print Japanese text files on a non-Japanese PostScript printer from a system that doesn't have Japanese locales installed?
In Solaris 7 and later, if any Unicode locales are installed on the system, such as en_US.UTF-8, you can print text files using the mp(1) program with the -L <localename> option. This creates a version of the contents in PostScript format and sends it to standard output.
Convert the Japanese text to UTF-8 text using the iconv(1) utility, as follows:
% iconv -f <eucJP or PCK> -t UTF-8 <filename> | /usr/bin/mp -L en_US.UTF-8 | lp -
Though you said that no Japanese locales are installed, if either the Japanese EUC or PCK locale were installed on the system, you could directly print files to a non-Japanese printer using the -M option:
% cat <Japanese EUC file> | /usr/bin/mp -L ja -M | lp -
% cat <Shift-JIS file> | /usr/bin/mp -L ja_JP.PCK -M | lp -
Note that the -M option was introduced in Solaris 9. Without this option, the PostScript file created by mp(1) would not include Japanese font glyph images.
Back to Top
2. How do I view Japanese text if I'm not running a Japanese locale?
You can view Japanese text in any Unicode locale by converting the file encoding to UTF-8 in a dtterm window. Use the iconv(1) utility and specify the fromcode name as either eucJP or PCK and the tocode name as UTF-8. For example:
% iconv -f <eucJP or PCK> -t UTF-8 <filename>
In Solaris 9 and later, you can convert the code when you open and save the file in a dtpad window.
Back to Top
3. Can I input Japanese characters only when running a Japanese locale?
You can input Japanese characters in any Unicode locale using the Table lookup input method or the Unicode Hexadecimal code input method. In Solaris 8 and later, if any Japanese locales are installed, you can also use the native Japanese input method, ATOK12, in any Unicode locale. If your system is running Solaris 8 and only the Japanese partial locale is installed (that is, the Solaris environment was installed from the Software CDs and not the Languages CDs), the native Japanese input method cs00 is available instead of ATOK12. (The cs00 Japanese input method is no longer supported, starting with the Solaris 9 operating environment.)
The most common ways to input Japanese characters, using ATOK12 and cs00, are described in the following manuals:
ATOK12 - Chapter 4 in Solaris 9 version of the "International Language Environments Guide" (http://docs.sun.com/db/doc/806-6642)
cs00 - Chapter 3 in Solaris 8 version of the "International Language Environments Guide" (http://docs.sun.com/db/doc/806-0169)
For detailed information (in Japanese only), see the ATOK12 User's Guide and cs00 User's Guide on docs.sun.com.
Back to Top
4. Can I display a document with Japanese characters in Netscape if all locales are installed on my system and I log in to the C locale? Do I have to set my font path? If so, how?
In answer to the first question, yes. Select a Japanese character set from the Character Set menu in Netscape. The Netscape browser should be able to display Japanese text since there are already Japanese fonts in the default font path (k14.pcf.Z in /usr/openwin/lib/X11/fonts/misc).
To display Japanese characters in the C locale running applications other than Netscape, you need to add a font path. The required font paths are listed in either the /usr/openwin/lib/locale/ja_JP.eucJP/OWfontpath file or the /usr/openwin/lib/locale/ja_JP.PCK/OWfontpath file. Add the listed lines using xset fp+, and in a dtterm window, enter the following:
env LANG=<locale> dtpad -standAlone
where <locale> is ja or ja_JP.eucJP for Japanese EUC text, ja_JP.PCK for PCK/shift-JIS text, and any UTF-8 locale names such as ja_JP.UTF-8 for Unicode text.
A dtpad window will appear and display the Japanese text.
Back to Top
5. What are the differences between the partial and full Japanese locales?
A partial locale includes a locale enabler, which ensures that all of the characters in a language can be entered, displayed, and printed, and also enables data handling of the character encoding supported by the locale.
A full locale includes a locale enabler, a translated GUI, and additional optional functions. For example, in Solaris 9, the following components are available only in the Japanese full locale environment with the Languages CD:
- Translated message, help, and man pages
- Wnn6 Japanese input method
- Japanese Solaris 1.x BCP support
- Mincho (min*) typeface bitmap fonts
- JIS X 0212 Type1 fonts for printing
- Japanese-specific dumb printer and jpostprint support
- Legacy Japanese utilities such as
kanji(1)
Partial locales lack the translated messages and a translated GUI.
For more details about the differences, see "Japanese Localization" in the "International Language Environment Guide" available on docs.sun.com.
Back to Top
6. How do I install Japanese locales after the Solaris OS has been installed?
You can install Japanese partial locale packages using the pkgadd(1M) command from the Software 1of2 and 2of2 CD-ROMs. This will enable you to type, display, and print Japanese text. Note that Solaris Web Start cannot be used to install locales on top of a base installation.
If you also want the Japanese GUI environment and additional software (such as optional fonts or optional input methods), you can install the Japanese full locale packages from the Languages CD using either the pkgadd command or the Languages CD installer. We recommend the Languages CD installer since you don't need to know the package names.
The list of locale packages is available in the appendix of the "International Language Environment Guide," available on docs.sun.com. You can also find them on the following web pages:
For a description of the Solaris 8 release, see http://developers.sun.com/dev/gadc/techtips/sol8_locale_pkgs/
For a description of the Solaris 9 release, see http://developers.sun.com/dev/gadc/techtips/sol9_locale_pkgs/
Adding a locale should not introduce any problems to the current data if the user is still using the current environment and locale.
Once you have added the Japanese locale packages, reboot the system and then log in to CDE with a Japanese locale. If you prefer, you can manually start or restart the htt input method server daemon and the Japanese input method daemon, though rebooting is the easiest way to start both daemons.
Back to Top
7. Does the isspace macro work with Asian locales?
No. The isspace(3C) macro, which tests for standard white-space characters, such as any space, tab, or carriage-return, works only with the single-byte characters of a locale. All Asian and Unicode locales are multibyte locales. Depending on which locale you're using, isspace(3C) usually checks just the ASCII area of the codeset.
For instance, the ja_JP.eucJP (Japanese EUC) multibyte codeset has ASCII/JIS X 0201 for the single-byte portion, and JIS X 0208 for the double-byte portion, JIS X 0201 half-width Katakana for the double-byte portion, and optionally JIS X 0212 for the triple-byte portion. Therefore the multibyte portions won't be supported by isspace(3C) or related character-handling macros and functions.
To check whether a given character is a space character in an Asian locale, use a wide character classification function, such as iswspace(3C).
Listed below are several other wide-character library functions that you might want to use. For descriptions, see the man page for each function.
isenglish(3C)
isideogram(3C)
isnumber(3C)
isphonogram(3C)
isspecial(3C)
iswalnum(3C)
iswalpha(3C)
iswascii(3C)
iswcntrl(3C)
iswctype(3C)
iswdigit(3C)
iswgraph(3C)
iswlower(3C)
iswprint(3C)
iswpunct(3C)
iswupper(3C)
iswxdigit(3C)
Back to Top
8. When a user logs in to a Japanese locale, what happens behind the scenes? At what point are Japanese characters displayed?
After the user selects a Japanese locale and the corresponding packages are installed, the input method daemon and other Japanese-specific daemons will run in the background. When Japanese input mode is on, the keyboard input is grabbed by Htt, the X Input Method Server. Htt communicates with the Japanese input daemon, such as ATOK12, to convert the input strings to Japanese characters. The results are sent back to the application that has the keyboard focus.
Japanese characters will not be displayed unless the user logs in to one
of the Japanese locales (ja, ja_JP.eucJP, ja_JP.PCK, or ja_JP.UTF-8)
from the CDE dtlogin menu. If Japanese characters are not displayed when the user is logged in to a Japanese locale, it is possible that only the partial Japanese locales were installed from the Software CDs.
If most of the GUI environment is in English but the user wants to use the Japanese GUI environment, he or she can install the Japanese message packages and extra features from the Languages CD using the Languages CD installer.
Back to Top
9. Can user accounts, files, and directories be named using multibyte characters (such as Kanji and Chinese) instead of ASCII? To what extent does Solaris support MBCS (multibyte character sets)?
You can use Asian characters in file contents, of course, but not in account names (user ids). You can also use Asian characters for file names and directory names, but the names will display correctly only in the corresponding locale. For example, if you name a file or directory using Japanese EUC multibyte characters, the name will display as garbage in all locales except the ja_JP.eucJP locale.
So, unless you are in a single-locale environment, you should use 7-bit ASCII characters and also preferably the Portable Character Set. This enables users to log in to any locale using any codeset and ensures portability to other platforms.
Back to Top
10. How do I change Japanese input modes on Type 5 and Type 6 keyboards?
You can switch input modes regardless of which keyboard you are using. For information, see the references at the end of Question 3.
Back to Top
|