1
0
Fork 0
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:
Joshua Peek 2011-09-09 10:49:49 -05:00
parent db11fdd2f6
commit 164b541013

View file

@ -159,6 +159,7 @@ module ExecJS
def sh(command)
output, options = nil, {}
options[:external_encoding] = @encoding if @encoding
options[:internal_encoding] = Encoding.default_internal || 'UTF-8'
IO.popen(command, options) { |f| output = f.read }
output
end