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

Ruby.getErrorStream() encoding bug #1879

Closed
guai opened this issue Aug 1, 2014 · 4 comments
Closed

Ruby.getErrorStream() encoding bug #1879

guai opened this issue Aug 1, 2014 · 4 comments

Comments

@guai
Copy link

guai commented Aug 1, 2014

In Ruby.getErrorStream() PrintStream getting constructed from $stderr IO.
And it does not use its encoding settings.
I got char conversion errors in some cases where $stderr's encoding is utf-8.

jruby 1.7.13 release.

@lucasallan
Copy link
Member

@guai Can you provide an example?

@guai
Copy link
Author

guai commented Oct 6, 2014

Can be fixed by changing
public IOOutputStream(final IRubyObject io) { this(io, true, true); }
to
public IOOutputStream(final IRubyObject io) { this(io, ((RubyIO)io).getInputEncoding(), true, true); }
and defailt ASCII encoding not set in this case
public IOOutputStream(final IRubyObject io, boolean checkAppend, boolean verifyCanWrite) { this(io, ASCIIEncoding.INSTANCE, checkAppend, verifyCanWrite); }

@MSNexploder
Copy link
Contributor

While it is true that IOOuputStream pretty much ignores the actual RubyIO encoding and uses ASCII as hardcoded default I have a hard time creating a proper repro.

@kares
Copy link
Member

kares commented May 29, 2017

@MSNexploder thanks ... and sice it was 1.7 while 9K did a rewrite on IO let's assume its fixed 👯‍♂️

@kares kares closed this as completed May 29, 2017
@kares kares added this to the Invalid or Duplicate milestone May 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants