]> granicus.if.org Git - icinga2/commitdiff
DaemonCommand#Run(): set code page to UTF-8 7346/head
authorAlexander A. Klimov <alexander.klimov@icinga.com>
Fri, 19 Jul 2019 15:58:56 +0000 (17:58 +0200)
committerAlexander A. Klimov <alexander.klimov@icinga.com>
Fri, 19 Jul 2019 16:00:46 +0000 (18:00 +0200)
refs #7110

lib/cli/daemoncommand.cpp

index 8091c403ef42138a158f25d5d7d1bcd9004bee7c..eb8c351d0166b4b766a8bb26ce958bf9767ba6d6 100644 (file)
@@ -24,7 +24,9 @@
 #include <iostream>
 #include <fstream>
 
-#ifndef _WIN32
+#ifdef _WIN32
+#include <windows.h>
+#else /* _WIN32 */
 #include <signal.h>
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -539,6 +541,10 @@ public:
  */
 int DaemonCommand::Run(const po::variables_map& vm, const std::vector<std::string>& ap) const
 {
+#ifdef _WIN32
+       SetConsoleOutputCP(65001);
+#endif /* _WIN32 */
+
        Logger::EnableTimestamp();
 
        Log(LogInformation, "cli")