diff --git a/lib/vagrant/util/safe_exec.rb b/lib/vagrant/util/safe_exec.rb index f7f5bdb81..53f0b2597 100644 --- a/lib/vagrant/util/safe_exec.rb +++ b/lib/vagrant/util/safe_exec.rb @@ -41,14 +41,14 @@ module Vagrant end else if Vagrant::Util::Platform.windows? - @@logger.debug("Converting command and arguments to single string for exec") + # Re-generate strings to ensure common encoding + @@logger.debug("Converting command and arguments to common UTF-8 encoding for exec.") @@logger.debug("Command: `#{command.inspect}` Args: `#{args.inspect}`") - full_command = "#{command} #{args.join(" ")}" - @@logger.debug("Converted command: #{full_command}") - Kernel.exec(full_command) - else - Kernel.exec(command, *args) + command = "#{command}".force_encoding("UTF-8") + args = args.map{|arg| "#{arg}".force_encoding("UTF-8") } + @@logger.debug("Converted - Command: `#{command.inspect}` Args: `#{args.inspect}`") end + Kernel.exec(command, *args) end rescue *rescue_from # We retried already, raise the issue and be done