diff --git a/lib/vagrant/util/which.rb b/lib/vagrant/util/which.rb index 090d84010..9a7ba5b23 100644 --- a/lib/vagrant/util/which.rb +++ b/lib/vagrant/util/which.rb @@ -29,7 +29,7 @@ module Vagrant exts = ENV['PATHEXT'].split(';') end - ENV['PATH'].split(File::PATH_SEPARATOR).each do |path| + ENV['PATH'].encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '').split(File::PATH_SEPARATOR).each do |path| exts.each do |ext| exe = "#{path}#{File::SEPARATOR}#{cmd}#{ext}" return exe if File.executable? exe