// ----------------------------------------------------------------------void MyClient::slotReadyRead(){ m_ptxtInfo->append("Received the ReadyRead() signal"); buffer.clear(); buffer.append(m_pTcpSocket->readAll()); QString str; str = buffer.data(); m_ptxtInfo->append(str); qDebug() << "slotReadyRead";}// -------------------------------------------------------
void MyClient::slotReadyRead(){ m_ptxtInfo->append("Received the ReadyRead() signal"); buffer.clear(); buffer.append(m_pTcpSocket->readAll()); QString str; QTextCodec *codec = QTextCodec::codecForName("UTF-8"); str = codec->toUnicode(buffer.data()); // str = buffer.data(); m_ptxtInfo->append(str); qDebug() << "slotReadyRead";}
QTextCodec *codec = QTextCodec::codecForName("CP1251"); QTextCodec::setCodecForLocale(codec); str = codec->toUnicode(buffer.data());
QTextCodec *codec = QTextCodec::codecForName("UTF-8"); QTextCodec::setCodecForLocale(codec); str = codec->toUnicode(buffer);
QTextCodec *codec = QTextCodec::codecForName("cp866"); str = codec->toUnicode(buffer);