From 23db9546c16c2be264cfc4f695f5738a2f5beeeb Mon Sep 17 00:00:00 2001 From: Chun Kuan Lee Date: Mon, 6 Aug 2018 01:03:33 +0000 Subject: utils: run commands using utf-8 string on Windows --- src/util.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/util.cpp b/src/util.cpp index 1aab85264f..83690d6276 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -58,6 +58,7 @@ #ifndef NOMINMAX #define NOMINMAX #endif +#include #include /* for _commit */ #include @@ -1135,7 +1136,11 @@ fs::path GetSpecialFolderPath(int nFolder, bool fCreate) void runCommand(const std::string& strCommand) { if (strCommand.empty()) return; +#ifndef WIN32 int nErr = ::system(strCommand.c_str()); +#else + int nErr = ::_wsystem(std::wstring_convert,wchar_t>().from_bytes(strCommand).c_str()); +#endif if (nErr) LogPrintf("runCommand error: system(%s) returned %d\n", strCommand, nErr); } -- cgit v1.2.3