Closed casperisfine closed 3 months ago
I augmented the spec a bit.
I also added a similar spec for #read
and amusingly TruffleRuby's behavior match MRI's on read
, just not on read_nonblock
.
@casperisfine The CI fails on Windows for the new specs, could you exclude the problematic specs on Windows (platform_is_not :windows
)?
It seems whether the encoding is changed depend on arguments for read
, see https://bugs.ruby-lang.org/issues/20416
Ref: https://github.com/ruby/ruby/commit/0ca7036682dad1caea4e7a4fe8fd908d94c878e8
- io.c (read_all): should associate default external encoding.
- io.c (io_read): should NOT associate default external encoding.
When provided a buffer MRI preserves the original encoding but TruffleRuby sets the encoding to
Encoding::BINARY
cc @eregon
Discovered as part of https://github.com/redis-rb/redis-client/pull/184