oracle / truffleruby

A high performance implementation of the Ruby programming language, built on GraalVM.
https://www.graalvm.org/ruby/
Other
3.02k stars 185 forks source link

`Encoding::Converter#insert_output` not implemented #3064

Open nirvdrum opened 1 year ago

nirvdrum commented 1 year ago

While working on improving the IRB test suite to run with TruffleRuby with @st0012, we discovered that Encoding::Converter#insert_output isn't implemented. I think this was overlooked because the method spec is empty, meaning we don't have any tags for it.

eregon commented 1 year ago

I'm a bit curious how IRB uses that method. I wish there would be no Encoding::Converter, only String#encode, but maybe that's not enough?

eregon commented 1 year ago

Found it: https://github.com/ruby/irb/blob/fd49135607e25eb3532f3464e7c59345b4001881/lib/irb.rb#L614-L634 Could that be done with String#encode's various options? Maybe with a :fallback Proc? If it's possible, that seems a lot simpler.