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

Dir.foreach does not allow encoding #2547

Closed
djberg96 opened this issue Feb 1, 2015 · 2 comments
Closed

Dir.foreach does not allow encoding #2547

djberg96 opened this issue Feb 1, 2015 · 2 comments

Comments

@djberg96
Copy link
Contributor

@djberg96 djberg96 commented Feb 1, 2015

jruby 9.0.0.0.pre1 (2.2.0p0) 2015-01-20 d537cab Java HotSpot(TM) Client VM 24.51-b03 on 1.7.0_51-b13 +jit [Windows 7-x86]

MRI allows Dir.foreach to accept an encoding, but it seems JRuby does not:

enc = Encoding::UTF_16LE
p Dir.foreach(Dir.pwd)
p Dir.foreach(Dir.pwd, encoding: enc) # ArgumentError with JRuby

However, see https://bugs.ruby-lang.org/issues/10815 as well.

@djberg96
Copy link
Contributor Author

@djberg96 djberg96 commented Feb 2, 2015

Ok, it seems I didn't understand the function prototype, so I've updated the example.

@headius
Copy link
Member

@headius headius commented Feb 24, 2015

Easy one to add...marking as beginner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants