|
中文等相关字符串的日志输出方法 目前输出有乱码
// nsCString receivedstr;
// LossyCopyUTF16toASCII(aValue, receivedstr);
// PR_LOG(gMsgDBViewLog, PR_LOG_ALWAYS,("subject: (%s)"),receivedstr.get());
// MessageBoxW(NULL, aValue.BeginReading(),L"received", MB_OK | MB_ICONERROR);
nsCString receivedstr;
LossyCopyUTF16toASCII(aValue, receivedstr);
PR_LOG(gMsgDBViewLog, PR_LOG_ALWAYS,("received: (%s)"),receivedstr.get());
#ifdef PR_LOGGING
// MessageBoxW(NULL, aValue.BeginReading(), L"date", MB_OK | MB_ICONERROR);
nsCAutoString datestr;
LossyCopyUTF16toASCII(aValue, datestr);
//MessageBox(NULL, L"date", datestr.get(), MB_OK | MB_ICONERROR);
PR_LOG(gMsgDBViewLog, PR_LOG_ALWAYS,("date: (%s)"),datestr.get());
#endif
nsCString RFC2;
RFC2.AppendInt(numHdrs);
nsAutoString Rf2;
CopyMUTF7toUTF16(RFC2,Rf2);
//MessageBoxW(NULL,Rf2.get(), L"R2", MB_OK | MB_ICONERROR);
#ifdef PR_LOGGING
char *flags2 = nullptr;
flags2 = (char *) PR_Calloc(1, lineLength+2);
PL_strncpy(flags2, line,lineLength);
nsCString RFC2(flags2);
nsAutoString Rf2;
CopyMUTF7toUTF16(RFC2,Rf2);
//MessageBoxW(NULL, L"HandleLine", L"R2", MB_OK | MB_ICONERROR);
//MessageBoxW(NULL, Rf2.get(), L"R2", MB_OK | MB_ICONERROR);
#endif
#ifdef PR_LOGGING
char *flags2 = nullptr;
flags2 = (char *) PR_Calloc(1, lineLength+2);
PL_strncpy(flags2, line,lineLength);
nsCString RFC2(flags2);
nsAutoString Rf2;
CopyMUTF7toUTF16(RFC2,Rf2);
//MessageBoxW(NULL, L"ParseFolderLine", L"R2", MB_OK | MB_ICONERROR);
MessageBoxW(NULL, Rf2.get(), L"R2", MB_OK | MB_ICONERROR);
#endif
#ifdef PR_LOGGING
PR_LOG(gParseMailboxLog, PR_LOG_ALWAYS,("11 time1:%u rcvTimeSecs:%u",m_receivedTime,rcvTimeSecs));
PRTime resultTime;
PRStatus timeStatus = PR_ParseTimeString (date->value, false, &resultTime);
if (PR_SUCCESS == timeStatus)
{
PR_LOG(gParseMailboxLog, PR_LOG_ALWAYS,("11 time2:%u",resultTime));
}
#endif
|
|