Skip to content

Commit

Permalink
Force encoding on command output strings
Browse files Browse the repository at this point in the history
Incompatible encodings will result in an error when the exception
is translated. The outputs may not be UTF-8 encoded so force
the encoding when providing the values in the exception.
  • Loading branch information
chrisroberts committed Nov 1, 2024
1 parent bf6f4ff commit 6be63b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/providers/virtualbox/driver/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,8 @@ def execute(*command, &block)
if errored
raise Vagrant::Errors::VBoxManageError,
command: command.inspect,
stderr: r.stderr,
stdout: r.stdout
stderr: r.stderr.to_s.force_encoding("UTF-8"),
stdout: r.stdout.to_s.force_encoding("UTF-8")
end
end

Expand Down

0 comments on commit 6be63b9

Please sign in to comment.