diff options
Diffstat (limited to 'lib/rubygems/source_index.rb')
-rw-r--r-- | lib/rubygems/source_index.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/rubygems/source_index.rb b/lib/rubygems/source_index.rb index 20b27733fc..4700fbbb89 100644 --- a/lib/rubygems/source_index.rb +++ b/lib/rubygems/source_index.rb @@ -85,7 +85,11 @@ class Gem::SourceIndex def load_specification(file_name) return nil unless file_name and File.exist? file_name - spec_code = File.binread(file_name).untaint + spec_code = if defined? Encoding then + File.read file_name, :encoding => 'UTF-8' + else + File.read file_name + end.untaint begin gemspec = eval spec_code, binding, file_name |