diff options
author | Chris Wilson <chris+github@qwirx.com> | 2011-08-27 14:49:46 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2011-08-27 14:49:46 +0000 |
commit | 5fd7d9cf62372790f4624df0eb06657924a49672 (patch) | |
tree | 298614296f647dce42e05b7eaf94c612c417119b | |
parent | a473bb0923b0f7800bb95ef96ba20f5cf6cbe5b4 (diff) |
Log failure to convert log string to console encoding on Windows.
-rw-r--r-- | lib/common/Logging.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/common/Logging.cpp b/lib/common/Logging.cpp index e4477a2c..83efbc23 100644 --- a/lib/common/Logging.cpp +++ b/lib/common/Logging.cpp @@ -346,8 +346,15 @@ bool Console::Log(Log::Level level, const std::string& rFile, #ifdef WIN32 std::string output = buf.str(); - ConvertUtf8ToConsole(output.c_str(), output); - fprintf(target, "%s\n", output.c_str()); + if(ConvertUtf8ToConsole(output.c_str(), output) == false) + { + fprintf(target, "%s (and failed to convert to console encoding)\n", + output.c_str()); + } + else + { + fprintf(target, "%s\n", output.c_str()); + } #else fprintf(target, "%s\n", buf.str().c_str()); #endif |