Skip to content

[fix] IO#reopen: copy encoding from source IO#9339

Merged
headius merged 1 commit into
jruby:jruby-10.0from
kares:io-enc-10
Mar 28, 2026
Merged

[fix] IO#reopen: copy encoding from source IO#9339
headius merged 1 commit into
jruby:jruby-10.0from
kares:io-enc-10

Conversation

@kares

@kares kares commented Mar 28, 2026

Copy link
Copy Markdown
Member

After reopen, the IO retained its old encoding settings instead of inheriting the source's external/internal encoding.

CRuby's io_reopen explicitly copies fptr->encs = orig->encs right after the mode assignment.

After reopen, the IO retained its old encoding settings instead of
inheriting the source's external/internal encoding.

CRuby's io_reopen explicitly copies fptr->encs = orig->encs
right after the mode assignment.
@kares kares added this to the JRuby 10.0.5.0 milestone Mar 28, 2026

@headius headius left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup makes sense. Test probably could move to ruby/spec.

@headius headius merged commit c7470c5 into jruby:jruby-10.0 Mar 28, 2026
304 of 307 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants