Permalink
Browse files

Force UTF-8 on external encoding

  • Loading branch information...
1 parent 355dbc6 commit 178166635f67add5f425595bcbc45782a8f488df @josh josh committed May 18, 2011
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/execjs/external_runtime.rb
@@ -134,6 +134,7 @@ def which(command)
if "".respond_to?(:force_encoding)
def sh(command)
output, options = nil, {}
+ options[:external_encoding] = 'UTF-8'
options[:internal_encoding] = @conversion[:from] if @conversion
IO.popen(command, options) { |f| output = f.read }
output.force_encoding(@conversion[:to]) if @conversion

0 comments on commit 1781666

Please sign in to comment.