|
CE上层使用的是Unicode
但是串口需要ASNI
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() |
|