Korean Solaris User's Guide

Appendix A Binary Compatibility Package

Applications compiled under Korean OpenWindows 2.x or Solaris 1.x or SunOS 4.x systems have different binary formats than the current Korean Solaris release. Older applications can nevertheless be run under the current Korean 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.


The following BCP command runs the compiled binary code of earlier SunOS4.x, Solaris 1.x, and Korean OpenWindows 2.xapplications without recompilation, although OpenWindows V2 Korean 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).


system% old_application_name -lc_basiclocaleoldlocale -lc_inputlang
    oldlocale -lc_displaylangoldlocale

The following example shows the command that you use to run the compiled binary code of an earlier version of the textedit application on a Korean current Solarissystem.


system% textedit -lc_displaylang korean -lc_basiclocale korean \
-lc_inputlang korean

Due to incompatibilities between Korean Solaris 2.x and 1.x applications, you cannot cut and paste Korean characters between them.

Korean Test Utilities

Every 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 Korean (KS C 5601) national standard character set. Except Korean isksc, they also assume that the character being tested is part of the national standard character set.

The arguments for the functions in the following table must be a character in WC, wchar_t. For more information, see the kctype(3x) man page.

Table A–1 Korean Character Classification Functions

Utility 

Description 

isksc

Returns true if it is in the KS C 5601 character set. 

iskroman

Returns true if it is a Roman character as defined by the KS C 5636 character set. 

iskromannum

Returns true if it is a Roman numeral symbol in the KS C 5601 character set. 

isksymbol

Returns true if it is a Latin symbol or special character in the KS C 5601 character set. 

iskparen

Returns true if it is a right or left parenthesis in the KS C 5601 character set. 

isklatin

Returns true if it is a Latin letter character in the KS C 5601 character set. 

iskletter

Returns true if it is a Korean vowel or consonant in the KS C 5601 character set. 

iskline

Returns true if it is a ruled line symbol in the KS C 5601 character set. 

iskunit

Returns true if it is a unit character in the KS C 5601 character set. 

isksci

Returns true if it is a scientific symbol in the KS C 5601 character set. 

iskgen

Returns true if it is a graphic or general symbol in the KS C 5601 character set. 

iskgreek

Returns true if it is a Greek character in the KS C 5601 character set. 

iskrussian

Returns true if it is a Russian character in the KS C 5601 character set. 

iskuser

Returns true if the character is in the user-defined area of the KS C 5601 character set. 

iskhanja

Returns true if it is an ideogram in the KS C 5601 character set. 

iskhangul

Returns true if it is a Hangul phonogram in the KS C 5601 character set. 

iskkata

Returns true if it is a Japanese Katakana character in the KS C 5601 character set. 

iskhira

Returns true if it is a Japanese Hiragana character in the KS C 5601 character set. 

Asian-Specific Utilities

This section describes functions for wide character and string input and output, character classification, and conversion functions for the Korean character sets. Asian Solaris software implements a wide character library for handling Korean character codes according to industry standards.

Routines that have Korean language-specific dependency are in their own language-specific library, which is linked with the corresponding C compiler option. In Korean Solaris, libkle is linked with -lkle. 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 the Solaris software defines in wchar.h as shown in the following example.


typedef long wchar_h;

In Solaris software, long is four bytes.

Conversion Utilities

The 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.

Programs that use the general multibyte conversion utilities should include the header files widec.h and wctype.h. Korean Solaris specific routines (such as iskxxx) are declared in ko/xctype.h.

Programs that use the general multibyte conversion utilities should include three header files: wctype.h, widec.h, andko/xctype.h.

Conversion Within a Code Set

The 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 kconv(3) for Korean.

Conversion for Korean Character Codes

The following routines perform character-based code conversion on the KS C 5601 character set. They convert characters in the set between Completion code (or EUC format) and Combination code (or Packed code). To use these routines, the library kle must be linked using the C compiler option -lkle. For more information, see the kconv(3x) man page.

Table A–2 Korean Code Conversion Functions

Function 

Description 

comptopack()

Converts a character in Completion code to Combination (packed) code of KS C 5601-1987. 

packtocomp()

Converts a character in Combination (Packed) code of KS C 5601-1987 to Completion code. 

wasuntojohap()

Converts a character in Completion code to Combination (Packed) code of KS C 5601-1992. 

packtocomp()

Converts a character in Combination (Packed) code of KS C 5601-1992 to Completion code.