Korean Solaris User's Guide

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 Solaris software defines in wchar.h as follows:


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, for example:

Programs using 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 using the general multibyte conversion utilities should include three header files: wctype.h, widec.h, and ko/xctype.h.

Conversion Within a Codeset

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