Chinese char code fix.

This commit is contained in:
cora32 2015-04-04 15:55:58 +03:00
parent e3407a5e11
commit 434b02f4cb
3 changed files with 13 additions and 2 deletions

View File

@ -386,6 +386,11 @@ int ContentFilter(const char *buff, int port, const char *ip, char *cp, int sz)
codec = QTextCodec::codecForName("Windows-1251"); codec = QTextCodec::codecForName("Windows-1251");
strLower = codec->toUnicode(buff); strLower = codec->toUnicode(buff);
} }
else if (strstri(cp, "gb") != NULL)
{
codec = QTextCodec::codecForName("GB2312");
strLower = codec->toUnicode(buff);
}
else strLower = QString(buff); else strLower = QString(buff);
strLower = strLower.toLower(); strLower = strLower.toLower();
@ -699,11 +704,16 @@ void putInFile(int flag, const char *ip, char *port, int size, char *finalstr, c
codec = QTextCodec::codecForName("UTF-8"); codec = QTextCodec::codecForName("UTF-8");
strf = codec->toUnicode(finalstr); strf = codec->toUnicode(finalstr);
} }
else if(strstri(cp, "cp") != NULL || strstri(cp, "windows") != NULL) else if (strstri(cp, "cp") != NULL || strstri(cp, "windows") != NULL)
{ {
codec = QTextCodec::codecForName("Windows-1251"); codec = QTextCodec::codecForName("Windows-1251");
strf = codec->toUnicode(finalstr); strf = codec->toUnicode(finalstr);
} }
else if (strstri(cp, "gb") != NULL)
{
codec = QTextCodec::codecForName("GB2312");
strf = codec->toUnicode(finalstr);
}
else strf = QString(finalstr); else strf = QString(finalstr);
if(flag != 6 && flag != 5 && flag != 4) if(flag != 6 && flag != 5 && flag != 4)

View File

@ -1624,6 +1624,7 @@ void _connect() {
if (Connector::_ConnectToPort((char*)ip.c_str(), portArr[i]) == -2) break; if (Connector::_ConnectToPort((char*)ip.c_str(), portArr[i]) == -2) break;
}; };
--cons; --cons;
stt->doEmitionUpdateArc(gThreads);
} }
else lk.unlock(); else lk.unlock();
} }

View File

@ -1 +1 @@
24B84-5FC 24B84-609