The conversion functions 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:
Characters within a codeset, such as converting uppercase ASCII to lowercase.
Between different conventions for national standard character sets, such as:
Between Combination and Completion code, both KS C 5601-1987 and KS C 5601-1992.
Between GB and EUC.
Between CNS 11643 code and Big5.
Between code formats (such as converting between EUC and WC).
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.
Simplified Chinese Solaris specific routines (such as iscxxx) are declared in zh/xctype.h.
Traditional Chinese Solaris specific routines (such as ishxxx) are declared in zh_TW/xctype.h.
Programs using general multibyte conversion utilities should include three header files: wctype.h, widec.h, plus one of the following locale-specific files:
ko/xctype.h (Korean)
zh/xctype.h (Simplified Chinese)
zh_TW/xctype.h (Traditional Chinese)
The locale/xctype.h file declares the Korean or Chinese locale-specific routines, which have names of the form:
iskxxxx (Korean)
iscxxxx (Simplified Chinese)
ishxxxx (Traditional Chinese)
As with classification functions described in the previous section, the use of these previously mentioned functions can be controlled by the setlocale function (described elsewhere in this and other chapters).
Locale-specific conversion routines (such as Korean comptopack or Chinese cgbtoeuc are contained in a locale-specific library:
libkle (Korean)
libcle (Simplified Chinese)
libhle (Traditional Chinese)
This library can be linked during compilation using the C compiler option:
-lkle (Korean)
-lcle (Simplified Chinese)
-lhle (Traditional Chinese)
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 for:
kconv(3)--Korean
cconv(3)--Simplified Chinese
hconv(3)--Traditional Chinese
The following routines are in the regular Chinese C library:
Table B-5 Simplified Chinese Case Conversion Functions (declared in zh/xctype.h)
Function |
Description |
---|---|
tocupper |
Converts codeset 1 Roman lowercase to uppercase |
toclower |
Converts codeset 1 Roman uppercase to lowercase |
Table B-6 Traditional Chinese Case Conversion Functions (declared in zh_TW/xctype.h)
Function |
Description |
---|---|
tohupper |
Converts codeset 1 Roman lowercase to uppercase |
tohlower |
Converts codeset 1 Roman uppercase to lowercase |
In 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 B-7 Simplified Chinese Codeset Conversion Functions
Function |
Description |
---|---|
atocgb |
Converts alphabetic or numeric characters in ASCII (codeset 0) to the corresponding characters in GB-2312-80 (codeset 1). |
cgbtoa |
Converts alphabetic or numeric characters in GB-2312-80 (codeset 1) to the corresponding characters in ASCII (codeset 0). |
For further information on these functions, see the man page for cconv()(3x).
The following routines perform character-based code conversion on the KS C 5601 character set. They convert characters 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-8 Korean Code Conversion Functions
Routine |
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. |
wansuntojohap |
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 . |