InnerhalbNach weiteren Dokumenten suchenSupport-Ressourcen | Dieses Buch im PDF-Format herunterladen (796 KB)
Appendix A Backward CompatibilityThis appendix contains information for making programs backward-compatible with earlier versions of Asian Solaris Software. Every utility described is supported, but for this version of Solaris, you are encouraged to use the XPG4 internationalization APIs as described in International Language Environments Guide. Simplified Chinese Test UtilitiesThese utilities test various aspects of the Simplified Chinese (GB-2312-80) national standard character set. They also assume that the character being tested is part of the national standard character set. The arguments for the functions in these tables must be a character in WC, wchar_t. For more information, see the cctype(3x) man page. Table A-1 Simplified Chinese Character Classification Functions
Two additional routines for Simplified Chinese, iscgb and isceuc, test for characters from the GB-2312-80 character set. The iscgb routine expects a wide character, and isceuc expects a GB-2312-80 character in EUC format. For more information, see the cctype(3x) man page. Table A-2 General Simplified Chinese General Character Classification Functions
Simplified Chinese Conversion UtilitiesThis section describes functions for wide character and string input and output, character classification, and conversion functions for the Simplified Chinese character sets. Solaris 2.7 software implements a wide character library for handling Simplified Chinese character codes according to industry standards. Routines that have Chinese language-specific dependency are in their own language-specific library, which is linked with the corresponding C compiler option. Simplified Chinese Solaris libcle is linked with -lcle Refer to the appropriate man pages 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: typedef long wchar_h; In Solaris software, long is four bytes. Conversion UtilitiesThe conversion functions described in this section are available, but you should use iconv() as a standard function. Simplified Chinese 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. Simplified Chinese Solaris specific routines (such as iscxxx) are declared in zh/xctype.h. Programs using general multibyte conversion utilities should include three header files: wctype.h, widec.h, and zh/xctype.h. The locale/xctype.h file declares the Chinese locale-specific routines, which have names of the form iscxxxx: As with the classification functions described in the previous section, the use of these functions can be controlled by the setlocale function (described elsewhere in this and other chapters). Locale-specific conversion routines (such as Chinese cgbtoeuc) are contained in the libcle library: This library can be linked during compilation using the C compiler option -lcle. Conversion Within a CodesetThe 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) and cconv(3). The following routines are in the regular Chinese C library: Table A-3 Simplified Chinese Case Conversion Functions (declared in zh/xctype.h)
Conversion Between Simplified Chinese CodesetsIn the Simplified Chinese character sets, the Roman characters and numbers in codeset 0 are repeated in codeset 1. The following functions test wide characters. Table A-4 Simplified Chinese Codeset Conversion Functions
For further information on these functions, see the man page for cconv()(3x). Conversion for Simplified Chinese Character CodesThe following routines do character-based code conversion on the GB-2312-80 character set. They convert characters and strings between EUC format and GB-2312-80 format. To use these routines, the library libcle must be linked using the C compiler option -lcle. For further information, see the cconv(3x) man page. Table A-5 Simplified Chinese Character-Based Functions
Binary Compatibility Package (BCP)Applications compiled under Chinese OpenWindows 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 its included binary compatibility package (BCP). Note - SUNWowbcp must be included in your system configuration in order for you to run the following commands. See your system administrator for installation. Running Earlier Binary CodeThe following BCP command runs the compiled binary code of earlier SunOS4.x /Solaris 1.x /Chinese OpenWindows 2.x applications without recompilation, although OpenWindows V2 Chinese applications 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 (oldlocale):
For a current Simplified Chinese Solaris release system to run the compiled binary code of an earlier version of the textedit application enter, for example:
Incompatibilities between Simplified Chinese Solaris 2.x and 1.x applications do not permit cutting and pasting of Chinese characters between them. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||