im chinese,so where i use qDebug() found a issue.qDebug() can't not output a chinese character in Winxp.
i follow this bug in qcoreapplication_win.cpp in corelib folder function qWinMsgHandler
Code:
Q_CORE_EXPORT void qWinMsgHandler(QtMsgType t, const char* str) { Q_UNUSED(t); // OutputDebugString is not threadsafe. // cannot use QMutex here, because qWarning()s in the QMutex // implementation may cause this function to recurse static QWinMsgHandlerCriticalSection staticCriticalSection; if (!str) str = "(null)"; staticCriticalSection.lock(); QT_WA({ OutputDebugStringW((TCHAR*)s.utf16()); }, { s += "\n"; OutputDebugStringA(s.data()); }) staticCriticalSection.unlock(); }
bug in QString s(QString::fromLatin1(str)); if str is a gb18030 codec.then will get a error code