mirror of
https://github.com/rails/execjs
synced 2023-03-27 23:21:20 -04:00
Ensure external runtime return value is utf8
This commit is contained in:
parent
db11fdd2f6
commit
164b541013
1 changed files with 1 additions and 0 deletions
|
@ -159,6 +159,7 @@ module ExecJS
|
||||||
def sh(command)
|
def sh(command)
|
||||||
output, options = nil, {}
|
output, options = nil, {}
|
||||||
options[:external_encoding] = @encoding if @encoding
|
options[:external_encoding] = @encoding if @encoding
|
||||||
|
options[:internal_encoding] = Encoding.default_internal || 'UTF-8'
|
||||||
IO.popen(command, options) { |f| output = f.read }
|
IO.popen(command, options) { |f| output = f.read }
|
||||||
output
|
output
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue