试试这个
C/C++ code
#include<comdef.h>char*str1="safdjkjlasfd";
_bstr str2=str1;
WCHAR*str3=str2;
- C/C++ code #include <comdef.h>
char *str1 = "hello中国人!";
WCHAR *str2 = _bstr_t(str1);
手机使用ucs2格式,ucs2 是utf16 的big endian格式,平常在windows下称呼的unicode是utf16的little endian格式。
一个字符'1',其unicode值是0x0031, 0x0031仍然是0x31,在具体实现上,ucs2表示成两个字节0x00, 0x31,而pc机上表现库0x31, 0x00。本质上是一样的。