diff --git a/src/kvirc/kernel/KviIrcConnection.cpp b/src/kvirc/kernel/KviIrcConnection.cpp index 94edc1b15..988c24dae 100644 --- a/src/kvirc/kernel/KviIrcConnection.cpp +++ b/src/kvirc/kernel/KviIrcConnection.cpp @@ -832,14 +832,12 @@ bool KviIrcConnection::sendData(const char * pcBuffer, int iBuflen) m_pConsole->outputNoFmt(KVI_OUT_SOCKETWARNING, __tr2qs("[LINK WARNING]: Socket message truncated to 512 bytes.")); } - KviDataBuffer * pData = new KviDataBuffer(iBuflen + 3); + KviDataBuffer * pData = new KviDataBuffer(iBuflen + 2); KviMemory::move(pData->data(), pcBuffer, iBuflen); *(pData->data() + iBuflen) = '\r'; *(pData->data() + iBuflen + 1) = '\n'; - *(pData->data() + iBuflen + 2) = '\0'; - QString szMsg = (const char *)(pData->data()); - szMsg.truncate(iBuflen); + QString szMsg = QString::fromUtf8((const char *)(pData->data()), iBuflen); // notify the monitors for(auto & m : context()->monitorList())