Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Force UTF-8 on external encoding

  • Loading branch information...
commit 178166635f67add5f425595bcbc45782a8f488df 1 parent 355dbc6
@josh josh authored
Showing with 1 addition and 0 deletions.
  1. +1 −0  lib/execjs/external_runtime.rb
View
1  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
Please sign in to comment.
Something went wrong with that request. Please try again.