SysTutorials

Linux Manual Pages › Section 3

mbstowcs(3)

NAME

mbstowcs – convert a multibyte string to a wide-character string

SYNOPSIS


#include <stdlib.h>
size_t mbstowcs(wchar_t *dest, const char *src, size_t n);

DESCRIPTION

If dest is not NULL, the mbstowcs() function converts the multibyte string src to a wide-character string starting at dest. At most n wide characters are written to dest. The sequence of characters in the string src shall begin in the initial shift state. The conversion can stop for three reasons:

1.
An invalid multibyte sequence has been encountered. In this case, (size_t) -1 is returned.
2.
n non-L’