Index: src/liblogger/TAsyncMultiLogger.cpp =================================================================== diff -u -rdc6fd9369a96f87d13abce9d111414b7642c0b67 -r800b6e4dd2e62623eab76ac2d16d63af2a67a045 --- src/liblogger/TAsyncMultiLogger.cpp (.../TAsyncMultiLogger.cpp) (revision dc6fd9369a96f87d13abce9d111414b7642c0b67) +++ src/liblogger/TAsyncMultiLogger.cpp (.../TAsyncMultiLogger.cpp) (revision 800b6e4dd2e62623eab76ac2d16d63af2a67a045) @@ -128,5 +128,4 @@ } while(!bStopProcessing); } - } Index: src/liblogger/TLogFile.cpp =================================================================== diff -u -r8f634460db3f225ca24f2e447b3730d4f0614166 -r800b6e4dd2e62623eab76ac2d16d63af2a67a045 --- src/liblogger/TLogFile.cpp (.../TLogFile.cpp) (revision 8f634460db3f225ca24f2e447b3730d4f0614166) +++ src/liblogger/TLogFile.cpp (.../TLogFile.cpp) (revision 800b6e4dd2e62623eab76ac2d16d63af2a67a045) @@ -21,6 +21,7 @@ #include #include #include +#include namespace logger { @@ -44,14 +45,18 @@ try { - for (const std::wstring& rEntry : rListEntries) + std::wstring_convert> utf8Converter; + + for (const std::wstring& rstrEntry : rListEntries) { - size_t stEntryLen = rEntry.length() * sizeof(wchar_t); + std::string strUtf8Line = utf8Converter.to_bytes(rstrEntry); + + size_t stEntryLen = strUtf8Line.length(); if (NeedRotation(stEntryLen)) RotateFile(); DWORD dwWritten = 0; - if (!WriteFile(GetFileHandle(), rEntry.c_str(), boost::numeric_cast(stEntryLen), &dwWritten, nullptr)) + if (!WriteFile(GetFileHandle(), strUtf8Line.c_str(), boost::numeric_cast(stEntryLen), &dwWritten, nullptr)) throw std::runtime_error("Cannot write to log, system error"); } }