MSDN:
wcstombs
Converts a sequence of wide characters to a corresponding sequence of multibyte characters.
Parameters
mbstr
The address of a sequence of multibyte characters
wcstr
The address of a sequence of wide characters
count
The maximum number of bytes that can be stored in the multibyte output string
Return Value
If wcstombs successfully converts the multibyte string, it returns the number of bytes written into the multibyte output string, excluding the terminating NULL (if any). If the mbstr argument is NULL, wcstombs returns the required size of the destination string. In versions of Windows CE prior to 3.0, setting mbstr to NULL returns -1. If wcstombs encounters a wide character it cannot be convert to a multibyte character, it returns –1 cast to type size_t.
或者用
MSDN:
MultiByteToWideChar
This function maps a character string to a wide-character (Unicode) string. The character string mapped by this function is not necessarily from a multibyte character set.