QUrl params; QTextCodec *utf8 = QTextCodec::codecForName("utf-8"); params.addQueryItem("signature",utf8->fromUnicode(QString::fromStdString("你們好")).toPercentEncoding()); params.addQueryItem("clientKey",utf8->fromUnicode(QString::fromStdString("/!@#$%*^*)\")).toPercentEncoding());
經過以上方式設置編碼,能夠保證服務的可以有效的收到數據.編碼