From 8bc0c343fafc1b8b63f70267f38b673e30827258 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Fri, 19 Oct 2018 13:11:43 +1100 Subject: [PATCH] fix: convert wstring to string on windows in node_bindings (#15266) --- atom/common/node_bindings.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/atom/common/node_bindings.cc b/atom/common/node_bindings.cc index 08ec30bcb8dd1..6daf548f6e965 100644 --- a/atom/common/node_bindings.cc +++ b/atom/common/node_bindings.cc @@ -228,7 +228,11 @@ void NodeBindings::Initialize() { if (env->HasVar("NODE_OPTIONS")) { base::FilePath exe_path; base::PathService::Get(base::FILE_EXE, &exe_path); +#if defined(OS_WIN) + std::string path = base::UTF16ToUTF8(exe_path.value()); +#else std::string path = exe_path.value(); +#endif std::transform(path.begin(), path.end(), path.begin(), ::tolower); #if defined(OS_WIN)