参考书上的解码函数
void DecodeUcs2(const unsigned char* ps,char *pd ,int Length)
{
int nDstLength=0;
WCHAR wchar[256];
for(int j=0;j<Length/2;j++)
{
wchar[j]=*ps++<<8;
wchar[j]|=(*ps++)&0xff;
}
nDstLength=::WideCharToMultiByte(CP_ACP,0,wchar,Length/2,pd,160,NULL,NULL);pd[nDstLength]='\0';但解出来的是"?????"无法现示的字符。
void DecodeUcs2(const unsigned char* ps,char *pd ,int Length)
{
int nDstLength=0;
WCHAR wchar[256];
for(int j=0;j<Length/2;j++)
{
wchar[j]=*ps++<<8;
wchar[j]|=(*ps++)&0xff;
}
nDstLength=::WideCharToMultiByte(CP_ACP,0,wchar,Length/2,pd,160,NULL,NULL);pd[nDstLength]='\0';但解出来的是"?????"无法现示的字符。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货