summaryrefslogtreecommitdiff
path: root/log.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss123next@list.ru>2010-10-21 05:34:01 +0300
committerGluzskiy Alexandr <sss123next@list.ru>2010-10-21 05:34:01 +0300
commitd5baf212f45c3926ffec3bccad77ca4dd0751d23 (patch)
tree4f32bd925082bc78ecdcf0a1e98b53655a8faa69 /log.cpp
parent64624c111e4a8a3a156190a8d6d3ee4d2e528f39 (diff)
using utf8<->utf16 on poor c++ instead of miranda api (can solve some issues with badly encoded messages, testing needed)
Diffstat (limited to 'log.cpp')
-rw-r--r--log.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/log.cpp b/log.cpp
index d4d65a7..a7395e6 100644
--- a/log.cpp
+++ b/log.cpp
@@ -22,12 +22,10 @@ logtofile& logtofile::operator<<(TCHAR *buf)
if(bDebugLog)
{
log_mutex.lock();
- char *tmp = mir_utf8encodeW(buf);
log.open(path, std::ios::app |std::ios::ate);
- log<<tmp;
+ log<<toUTF8(buf);
log.close();
log_mutex.unlock();
- mir_free(tmp);
}
return *this;
}
@@ -37,12 +35,10 @@ logtofile& logtofile::operator<<(char *buf)
if(bDebugLog)
{
log_mutex.lock();
- char *tmp = mir_utf8encode(buf);
log.open(path, std::ios::app |std::ios::ate);
- log<<tmp;
+ log<<buf;
log.close();
log_mutex.unlock();
- mir_free(tmp);
}
return *this;
}
@@ -67,12 +63,10 @@ logtofile& logtofile::operator<<(wstring buf)
if(bDebugLog)
{
log_mutex.lock();
- char *tmp = mir_utf8encodeW(buf.c_str());
log.open(path, std::ios::app |std::ios::ate);
- log<<tmp;
+ log<<toUTF8(buf);
log.close();
log_mutex.unlock();
- mir_free(tmp);
}
return *this;
}