Multibyte Characters A multibyte character can hold code-point values greater than 255. One multibyte character can range from two to four bytes in length. Asian code sets are multibyte code sets; they contain both single-byte and multibyte characters. If your application processes multibyte characters, it can no longer make the same assumption as for single-byte characters. The number of bytes in a buffer no longer equals the number of characters in the buffer. Because of the potential of varying number of bytes for each character, you can no longer rely on the C compiler to perform the following operations correctly:
ifx_gl_mb
A multibyte character
ifx_gl_mbs
A multibyte-character string
For example, the function ifx_gl_mblen() determines the length of a multibyte character while ifx_gl_mbslen() determines the length of a multibyte-character string. The gl_mchar_t Data Type The INFORMIX-GLS library represents a multibyte character with the gl_mchar_t data type. The gls.h header file defines the gl_mchar_t data type and the ifxgls.h header file includes gls.h. Therefore, you must include ifxgls.h in any file that uses the gl_mchar_t data type (or any INFORMIX-GLS function).
You can also cast a C string to a multibyte-character string, as follows:
ifx_gl_wc
A wide character
ifx_gl_wcs
A wide-character string
For example, the function ifx_gl_wctomb() converts a wide character to a multibyte character, and ifx_gl_wcslen() determines the length of a wide-character string. The gl_wchar_t Data Type The INFORMIX-GLS library represents a wide character with the gl_wchar_t data type. The gls.h header file defines the gl_wchar_t data type, and the ifxgls.h header file includes gls.h. Therefore, you must include ifxgls.h in any file that uses the gl_wchar_t data type (or any INFORMIX-GLS function).
You can compare or assign a single-byte ASCII character or character constant to a single wide character, as in the following code fragment: