The ifx_gl_mbtowc() function

The ifx_gl_mbtowc() function converts one multibyte character to its wide-character representation.

Syntax

#include <ifxgls.h>
...
int ifx_gl_mbtowc(wc, mb, mb_byte_limit)
       gl_wchar_t *wc;
       gl_mchar_t *mb;
       int mb_byte_limit;
wc
A pointer to the wide-character string that contains the wide-character equivalent of mb.
mb
A pointer to the multibyte-character to convert to the wc wide-character .
mb_byte_length
The integer number of bytes to read from mb to try to form a complete multibyte character. If mb_byte_limit is IFX_GL_NO_LIMIT, the function reads as many bytes as necessary from mb to form a complete character.
Valid in client application Valid in DataBlade® UDR
Yes Yes

Usage

The ifx_gl_mbtowc() function converts the multibyte character mb into its wide-character representation and stores the result in the wide character that wc references.

Return values

>=0
The number of bytes read from mb.
-1
The function was not successful, and the error number is set to indicate the cause. See the Errors section.

Errors

If an error occurred, this function returns -1 and sets the ifx_gl_lc_errno() error number to one of the following values.
IFX_GL_EILSEQ
The *mb value is not a valid multibyte character.
IFX_GL_EINVAL
The function cannot determine whether mb is a valid multibyte character because it would need to read more than mb_byte_limit bytes from mb. If mb_byte_limit is less than or equal to 0, this function always returns this error.