|
| 以 PDF 格式下载本书 (944 KB)
Appendix A Binary Compatibility PackageApplications compiled under Chinese OpenWindowsTM 2.x or Solaris 1.x or SunOS 4.x systems have different binary formats than the current Chinese Solaris release. Older applications can nevertheless be run under the current Chinese release without being recompiled by using the application's included binary compatibility package (BCP). Note – SUNWowbcp must be included in your system configuration in order to run the following commands. See your system administrator for installation. The following BCP command runs the compiled binary code of earlier SunOS4.x, Solaris 1.x, or Chinese OpenWindows 2.x applications without recompilation, However, OpenWindows V2 Chinese applications will display no input server status region. As shown in the following examples, the command calls the application by its old name (old_application_name) and sets the basic locale, input language, and display language using the older version's specific locale name (old-locale):
The following example shows the command you use to run the compiled binary code of an earlier version of the textedit application on the current Traditional Chinese Solaris Operating System:
Due to incompatibilities between Traditional Chinese Solaris 2.x and 1.x applications, you cannot cut and paste Chinese characters between them. Traditional Chinese Test UtilitiesEvery utility listed in this section is supported, but for this version of Solaris, you are encouraged to use the XPG4 internationalization APIs as described in the International Language Environments Guide. The utilities in the following table test various aspects of the Traditional Chinese (CNS 11643) national standard character set. These utilities also assume that the character being tested is part of the national standard character set. Each utility returns true if the character meets the test requirement referenced in the description. The arguments for the functions in the following table must be characters in wide character code (WC), wchar_t. For more information, see Asian-Specific Utilities and the hctype(3x) man page. Table A–1 Traditional Chinese Test Utilities
Asian-Specific UtilitiesThis section describes functions for wide character and string input and output, character classification, and conversion functions for the Korean or Chinese character sets. Asian Solaris software implements a wide character library for handling Korean or Chinese character codes according to industry standards. Routines that have Korean or Chinese language-specific dependency are in their own language-specific library, which is linked with the corresponding C compiler option. In the Traditional Chinese Solaris software, libhle is linked with -lhle. Refer to the appropriate man page for more information. Asian Solaris software defines WC as a constant-width, four-byte code. WC uses the ANSI C data type wchar_t, which Solaris software defines in wchar.h as follows:
In Solaris software, long is four bytes. Conversion UtilitiesThe conversion utilities described in this section are available, but you should use iconv as a standard function. Asian Solaris software provides facilities for various conversions, for example:
Programs using the general multibyte conversion utilities should include the header files widec.h and wctype.h. Traditional Chinese Solaris routines (such as ishxxx) are declared in zh_TW/xctype.h. Programs using the general multibyte conversion utilities should include three header files: wctype.h, widec.h, and zh_TW/xctype.h. As with classification functions described in the previous section, the use of these utilities can be controlled by the setlocale function. Locale-specific routines are contained in a locale-specific library. For Traditional Chinese, that library is libhle. The library can be linked during compilation using the C compiler option -lhle. Conversion Within a Code SetThe multibyte conversion functions are similar to the one-byte conversion functions toupper() and tolower(). These functions convert wide-characters to other wide characters. For more information on conversion routines, see the man pages for wconv(3) for all locales and hconv(3) for Traditional Chinese. The routines listed in the following table are in the regular Chinese C library: Table A–2 Chinese C Library Conversion Routines
Conversion for Traditional Chinese Character CodesThe routines listed in the following table perform character-based code conversion on the CNS-11643 character set. They convert characters in the set between CNS-11643, EUC, and Big5 formats. To use these routines, the library hle must be linked using the C compiler option -lhle. For more information, see the hconv(3x) man page. Table A–3 Character-Based Code Conversion Routines
Table A–4 Character-Based Code Conversion Routines (cont)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||