Guardian C Library Calls Reference Manual
Reference to Library Calls
Guardian TNS C Library Calls Reference Manual—128833 3-237
wcstombs
wcstombs
The wcstombs function converts a sequence of wide characters into a sequence of
multibyte characters.
s
points to the array that will hold the multibyte characters.
pwcs
points to the array that contains the sequence of wide characters to be converted.
n
specifies the total number of bytes that can be modified in the array pointed to by s.
Return Value
(size_t) -1 if a wide character is encountered that does not correspond to a valid
multibyte character.
Otherwise, the function returns the number of bytes copied to the array pointed to by
s. If a null terminator is present, it is not included in the count.
Usage Guidelines
•
The conversion stops if the sequence of multibyte characters in the array pointed to
by s exceeds the limit of n total bytes or if a null character is encountered.
•
The behavior of the wcstombs function is affected by the LC_CTYPE category of
the current locale.
#include <stdlibh>
size_t wcstombs(char *s, const wchar_t *pwcs, size_t n);