char ch[7];
ch[0] = 0x20;
ch[1] = 0x20;
ch[2] = 0x2E;
ch[3] = 0xD9;
ch[4] = 0xD3;
ch[5] = 0xFE;
ch[6] = 0xD3;
int unicodeLen=MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,ch,-1,NULL,0); 如上代码,为什么unicodeLen的值为19?
ch[0] = 0x20;
ch[1] = 0x20;
ch[2] = 0x2E;
ch[3] = 0xD9;
ch[4] = 0xD3;
ch[5] = 0xFE;
ch[6] = 0xD3;
int unicodeLen=MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,ch,-1,NULL,0); 如上代码,为什么unicodeLen的值为19?
UINT CodePage, // code page
DWORD dwFlags, // character-type options
LPCSTR lpMultiByteStr, // string to map
int cbMultiByte, // number of bytes in string
LPWSTR lpWideCharStr, // wide-character buffer
int cchWideChar // size of buffer
);cbMultiByte
[in] Specifies the size in bytes of the string pointed to by the lpMultiByteStr parameter, or it can be -1 if the string is null terminated. Note that if cbMultiByte is 0, the function fails.
ch[0] = 0x20;
ch[1] = 0x20;
ch[2] = 0x2E;
ch[3] = 0xD9;
ch[4] = 0xD3;
ch[5] = 0xFE;
ch[6] = 0xD3;
ch[7] = 0;