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

This commit is contained in:
Samuel Attard 2018-10-19 13:11:43 +11:00 committed by GitHub
parent 37f2113032
commit 8bc0c343fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -228,7 +228,11 @@ void NodeBindings::Initialize() {
if (env->HasVar("NODE_OPTIONS")) { if (env->HasVar("NODE_OPTIONS")) {
base::FilePath exe_path; base::FilePath exe_path;
base::PathService::Get(base::FILE_EXE, &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(); std::string path = exe_path.value();
#endif
std::transform(path.begin(), path.end(), path.begin(), ::tolower); std::transform(path.begin(), path.end(), path.begin(), ::tolower);
#if defined(OS_WIN) #if defined(OS_WIN)