Skip to content

Commit

Permalink
- The encoding of a gem's YAML spec is now UTF-8. Issue rubygems#149
Browse files Browse the repository at this point in the history
  • Loading branch information
drbrain committed Aug 9, 2011
1 parent 27b7001 commit 18a1eaf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/rubygems/package/tar_input.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,13 @@ def initialize(io, security_policy = nil)
sio.rewind
end

# TODO use Gem.gunzip
gzis = Zlib::GzipReader.new(sio || entry)
# Ruby 1.8 doesn't have encoding and YAML is UTF-8
args = [sio || entry]
args << { :external_encoding => Encoding::UTF_8 } if
Object.const_defined?(:Encoding)

gzis = Zlib::GzipReader.new(*args)

# YAML wants an instance of IO
@metadata = load_gemspec(gzis)
has_meta = true
Expand Down

0 comments on commit 18a1eaf

Please sign in to comment.