70,023
社区成员




#include <stdio.h>
#include <stdlib.h>
#include <Windows.h>
int main(int argc, char *argv[])
{
char *testStr = "中";
unsigned short outputStr[20] = {0};
int unicodeLen = 0;
int i = 0;
unicodeLen = MultiByteToWideChar( CP_ACP,
0,
testStr,
-1,
NULL,
0 );
MultiByteToWideChar( CP_ACP,
0,
testStr,
-1,
(LPWSTR)outputStr,
unicodeLen );
for (i=0;i<unicodeLen/2;i++)
{
printf("[%d]%x\r\n",i,outputStr[i]);
}
return 0;
}