#20919 may be related. If the PR for this issue is accepted, it likely determines how that issue should be addressed. There's already a PR that is several months old associated with it.javanthropus (Jeremy Bopp)
I'm not sure if it meets your needs, but I just released an update to the [io-like gem](https://rubygems.org/gems/io-like) that brings it into the Ruby 3.x age. It uses primitive IO functions as a base and implements virtually all of th...javanthropus (Jeremy Bopp)
Note that replacing `#readline` with `#gets` in the examples causes the issue to be seen in all Ruby versions, including 3.3.6.javanthropus (Jeremy Bopp)
```ruby require 'tempfile' Tempfile.open(binmode: true, encoding: 'utf-32le') do |f| f.write('0123456789') f.rewind # A limit that would truncate a character becomes completely ignored f.readline(3).bytesize # => 40; s...javanthropus (Jeremy Bopp)
@nobu, I just checked with a fresh build of the master branch, and the second failure case I mentioned in my previous message still exists. I opened #20919 to cover it.javanthropus (Jeremy Bopp)
When transcoding characters, `IO#seek` and `IO#pos=` only clear the internal character buffer if `IO#getc` is called first: ```ruby require 'tempfile' Tempfile.open(encoding: 'utf-8:utf-16le') do |f| f.write('0123456789') f....javanthropus (Jeremy Bopp)
> Since io.pos (not assignment) looks mere attribute, differentiated from seek. If not for the fact that `IO#seek` always returns 0 regardless of its arguments (something I've never understood), `IO#pos` could be implemented as `IO#se...javanthropus (Jeremy Bopp)