会AT_COMMand的大侠请进
我用AT+CPBR=1,4 得出
+CPBR: 1,"13560034389",129,"80679779CB6B66FFFF"
+CPBR: 2,"477863",129,"80624B673A5361FFFF"
+CPBR: 3,"13826037365",129,"8099965BCCFFFF"
+CPBR: 4,"13826493264",129,"805C0F96C4FFFF"
请问应该怎么对最后面"8099965BCCFFFF"的进行解码成中文。
十分感谢!!!!
C#
[解决办法]
C#的话我不知道该怎么操作了,C++的话就是把这些UNICODE码的数值放到内存中,按宽字符寻址出来的就是中文了,给一段C++代码给你参考一下。
VOID HexStr2Unicode(const std::string HexStr, wchar_t UnicodeStr[1024]){ int i, j; int iStrLen; int iTemp; CHAR *p = NULL; CHAR HexChar[1024]; ZeroMemory(HexChar, sizeof(HexChar)); strcpy(HexChar, HexStr.c_str()); ZeroMemory(UnicodeStr, 1024 * sizeof(wchar_t)); CHAR TempChar[32]; ZeroMemory(TempChar, sizeof(TempChar)); iStrLen = strlen(HexChar); for (i = 0, j = 0; i < iStrLen; i+=2,j++) { memcpy(TempChar, HexChar + i, 2); sscanf(TempChar, "%x", &iTemp); p = (CHAR*)UnicodeStr; if (j % 2 == 0) { p[j+1] = iTemp; } else if (j % 2 == 1) { p[j-1] = iTemp; } }}