Skip to content

Commit

Permalink
[build] More robust way to enforce UTF-8 output encoding from an exte…
Browse files Browse the repository at this point in the history
…rnal process
  • Loading branch information
barancev committed Mar 20, 2020
1 parent c8b88cd commit 04325f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rake_tasks/bazel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def self.execute(kind, args, target, &block)
if SeleniumRake::Checks.windows?
cmd = cmd + ["2>&1"]
cmd_line = cmd.join(' ')
cmd_out = `#{cmd_line}`.force_encoding("UTF-8")
cmd_out = `#{cmd_line}`.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')
cmd_exit_code = $?.success?
else
Open3.popen2e(*cmd) do |stdin, stdouts, wait|
Expand Down

0 comments on commit 04325f4

Please sign in to comment.