(Ruby version 3.3.1)
Hi!
When I specify the internal_encoding option to GzipReader.open or GzipReader.new, this seems to override whatever was set by the external_encoding option.
Example:
When not specifying internal_encoding, we get the expected external_encoding:
Zlib::GzipReader.open('myfile.gz',external_encoding: 'iso-8859-1')do |gz|
putsgz.external_encodingendoutput:
But with internal_encoding specified, external_encoding is changed:
Zlib::GzipReader.open('myfile.gz',external_encoding: 'iso-8859-1',internal_encoding: 'utf-8')do |gz|
putsgz.external_encodingendoutput:
This seems broken, right? I'm not getting the problem with File.open.
Additionally, I noticed GzipReader does not respond to internal_encoding:
Zlib::GzipReader.open('myfile.gz')do |gz|
putsgz.internal_encodingendThis throws NoMethodError with message:
undefined method `internal_encoding' for #<Zlib::GzipReader:0x00007f4c616a4e10> (NoMethodError)
Did you mean? external_encoding
Regards,
Olof
(Ruby version 3.3.1)
Hi!
When I specify the
internal_encodingoption toGzipReader.openorGzipReader.new, this seems to override whatever was set by theexternal_encodingoption.Example:
When not specifying
internal_encoding, we get the expectedexternal_encoding:output:
But with
internal_encodingspecified,external_encodingis changed:output:
This seems broken, right? I'm not getting the problem with
File.open.Additionally, I noticed
GzipReaderdoes not respond tointernal_encoding:This throws
NoMethodErrorwith message:Regards,
Olof