wcstombs()

Translate a wchar_t type character array to a multibyte character array encoded as defined by the LC_CTYPE category of the current locale.

  #include <stdlib.h>
  
  size_t wcstombs(char *s, const wchar_t *pwcs, size_t n);    
Parameter

s

A pointer to a multibyte character string destination for the conversion.

pwcs

A pointer to the wide-character string to convert.

n

The maximum number of wide characters in pwcs to convert.

Remarks

The EWL implementation of the wcstombs() function converts a character array containing wchar_t type Unicode characters to a character array containing multibyte characters encoded as defined by the LC_CTYPE category of the current locale. The wchar_t type is defined in stddef.h. Each wide character is converted as if by a call to the wctomb() function. No more than n bytes will be modified in the array pointed to by s.

The function terminates prematurely if a nul character is reached.

wcstombs() returns the number of bytes modified in the character array pointed to by s, not including a terminating null character, if any.