From: <cf...@us...> - 2010-05-13 22:58:38
|
Revision: 1985 http://znc.svn.sourceforge.net/znc/?rev=1985&view=rev Author: cflakes Date: 2010-05-13 22:58:32 +0000 (Thu, 13 May 2010) Log Message: ----------- Added some debug output to the charset module. Modified Paths: -------------- trunk/modules/extra/charset.cpp Modified: trunk/modules/extra/charset.cpp =================================================================== --- trunk/modules/extra/charset.cpp 2010-05-13 19:49:52 UTC (rev 1984) +++ trunk/modules/extra/charset.cpp 2010-05-13 22:58:32 UTC (rev 1985) @@ -67,6 +67,8 @@ { if(sData.empty()) return true; + DEBUG("charset: Trying to convert [" + sData.Escape_n(CString::EURL) + "] from [" + sFrom + "] to [" + sTo + "]..."); + iconv_t ic = iconv_open(sTo.c_str(), sFrom.c_str()); if(ic == (iconv_t)-1) return false; @@ -108,9 +110,14 @@ if(bResult) { - sData.erase(); - sData.append(pResult, uLength); + sData.assign(pResult, uLength); + + DEBUG("charset: Converted: [" + sData.Escape_n(CString::EURL) + "] from [" + sFrom + "] to [" + sTo + "]!"); } + else + { + DEBUG("Conversion failed: [" << uResult << "]"); + } delete[] pResult; @@ -131,6 +138,7 @@ if(uTest != (size_t)-1 && uTest != (size_t)-2) { + DEBUG("charset: [" + sData.Escape_n(CString::EURL) + "] is valid [" + sTo + "] already."); return true; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |