Browse Source

fix: convert wstring to string on windows in node_bindings (#15266)

Samuel Attard 6 years ago
parent
commit
8bc0c343fa
1 changed files with 4 additions and 0 deletions
  1. 4 0
      atom/common/node_bindings.cc

+ 4 - 0
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)