qt 遇到发送的字符串为BGK格式的解析方法
GBK模式可以兼容asiic,这一点非常好
注意引入头文件 #include <QTextCodec>
QString sendModeMessage = ""; //sendModeMessage = QString(QByteArray(pt.sendModeMessage).toHex()).toUpper();//3078303020B4A5B7A2C9CFB1A8 QTextCodec *code=QTextCodec::codecForName("GBK"); QTextDecoder *decode = code->makeDecoder(); sendModeMessage = decode->toUnicode(pt.sendModeMessage);
//结果为 0x00 触发上报