From 164b541013a0880850ce4b8fe4c57caefeb4a7ca Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Fri, 9 Sep 2011 10:49:49 -0500 Subject: [PATCH] Ensure external runtime return value is utf8 --- lib/execjs/external_runtime.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/execjs/external_runtime.rb b/lib/execjs/external_runtime.rb index ba20613..2c5a452 100644 --- a/lib/execjs/external_runtime.rb +++ b/lib/execjs/external_runtime.rb @@ -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