Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
wcstombs(3) OSS Library Calls Reference Manual
RETURN VALUES
If the wcstombs( ) function does not encounter an invalid wide-character code, it returns the
number of bytes stored, not including the terminating null byte. When the wcstombs( ) function
encounters a wide character code that does not correspond to a valid multibyte character, it
returns a value of -1 cast to size_t and sets errno to indicate the error.
If the wcstombs( ) function cannot store all of the converted characters in the output array, it
stops before storing a character that would overflow the output array, and returns the number of
bytes stored in the array. When the return value is n, the output array is not null terminated.
If the s parameter is a null pointer, the wcstombs( ) function returns the number of bytes required
for the character array.
ERRORS
If any of the following conditions occur, the wcstombs( ) function sets errno to the correspond-
ing value:
[EILSEQ] The array pointed to by the pwcs parameter contains an entry that does not
correspond with a valid multibyte character.
RELATED INFORMATION
Functions: mblen(3), mbstowcs(3), mbtowc(3), wcslen(3), wctomb(3).
8−42 Hewlett-Packard Company 527187-017