Actions
Bug #20416
closedIO#read doesn't change buffer encoding unless `maxlen = nil`
Description
IO#read(nil, buffer)
doesn't change buffer's encoding, but it does when maxlen
parameter is specified:
buffer = "".encode(Encoding::ISO_8859_1)
p File.open("test.rb").read(1000, buffer).encoding # => #<Encoding:ISO-8859-1>
buffer = "".encode(Encoding::ISO_8859_1)
p File.open("test.rb").read(nil, buffer).encoding # => #<Encoding:UTF-8>
I would expect changing buffer encoding in all the cases.
Actions
Like0
Like0Like0Like0Like0Like0Like0Like0