Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support encoding keyword in initialize (JRuby) #45

Merged
merged 1 commit into from
Apr 13, 2023

Conversation

headius
Copy link
Contributor

@headius headius commented Feb 6, 2023

This PR will add support for the encoding keyword to initialize in the JRuby extension.

Unfortunately there appears to be no tests for this behavior, so adding some may have to be part of this work.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
There appears to be no tests for this, but it was reported as
missing behavior in jruby/jruby#7478. This change accepts the
encoding keyword and sets it into the StringIO object, but uses
of that encoding are still missing. In CRuby calls to the get_enc
macro are used when reading from the StringIO, to encode the
resulting Strings. These changes will come in a future commit.
@headius
Copy link
Contributor Author

headius commented Feb 6, 2023

@hsbt Has this repository been synced with the CRuby repository recently?

@hsbt
Copy link
Member

hsbt commented Feb 6, 2023

@headius Yes, they are completely same files with ruby/ruby HEAD.

@kou
Copy link
Member

kou commented Apr 13, 2023

@headius Should we merge this for a new release?

@headius
Copy link
Contributor Author

headius commented Apr 13, 2023

Yes this can be merged and released. I had wanted to add some tests for the encoding behavior but never got around to it.

@headius headius merged commit 1977eb1 into ruby:master Apr 13, 2023
@headius headius deleted the stringio_encoding branch April 13, 2023 19:45
@headius
Copy link
Contributor Author

headius commented Apr 13, 2023

Merging this was perhaps a little premature but it does not hurt anything and allows the encoding keyword to be passed without error. There's still work to be done to hook up the encoding to all of the I/O methods, but without tests for that behavior it's hard to know whether I'm implementing it right. In any case, I will handle the additional work myself and it's not necessary for this release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants