|
多字节和宽字符之间转换的函数:mbstowcs, mbtowc, wcstombs, wctomb.
mbstowcs---Convert a multi-byte(ANSI) string to wide character stirng(Unicode).
wcstombs---Convert a wide character string to multi-byte string.
WCHAR szwcBuffer[100];
char szBuffer[100];
char* lpszConvert = "ANSI String to convert";
WCHAR* lpszwcConvert = _T("Unicode string to convert");
int nChars;
nChars = mbstowcs(szwcBuffer, lpszConvert, 100);
nChars = wcstombs(szBuffer, lpszwcConvert, 100);
//MultiByteToWideChar, WideCharToMultByte. //用在code page(编码页) |
|