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

Fix for issue 2182 on jruby-1_7 : Struct#inspect with utf8 encode string member #2321

Merged
merged 1 commit into from Feb 2, 2015

Conversation

k77ch7
Copy link
Contributor

@k77ch7 k77ch7 commented Dec 15, 2014

This commit fixes issue #2182 on jruby-1_7 branch. Inspect method of Struct with utf8 string member should return a utf8 string.

@enebo
Copy link
Member

enebo commented Dec 15, 2014

Converting to a Java charset feels really wrong to me. For 1.9 support I would almost prefer working directly with a RubyString and using cat19 over that. The main problem is not all supported Encodings in Ruby have an equaivalent Java Charset (although this is pretty rare). I won't close this atm and perhaps @headius or @lopex may have a better solution. I feel like this entire method needs to be rewritten and split out from the 1.8 version on it atm.

@lopex
Copy link
Member

lopex commented Dec 15, 2014

MRI uses rb_str_append for members and rb_str_cat2 for fixed parts of the result

@k77ch7 k77ch7 force-pushed the GH-2182_struct_has_ascii_encoding branch from 4d99577 to 1a9ef29 Compare December 16, 2014 14:53
@k77ch7
Copy link
Contributor Author

k77ch7 commented Dec 16, 2014

@enebo @lopex Thank you for your advice. I was refactoring the code. And I was adding the test case of a Struct with utf8 symbol. Please review 1a9ef29.

@headius
Copy link
Member

headius commented Jan 12, 2015

@k77ch7 Since your second commit corrects flaws (duplication of cat19 logic) in the first one, can you force push this all as a single commit please?

Thanks for your help!

@k77ch7 k77ch7 force-pushed the GH-2182_struct_has_ascii_encoding branch from 1a9ef29 to 4bf84a9 Compare January 14, 2015 13:14
@k77ch7 k77ch7 force-pushed the GH-2182_struct_has_ascii_encoding branch from 4bf84a9 to 5879d5b Compare January 14, 2015 13:24
@k77ch7
Copy link
Contributor Author

k77ch7 commented Jan 14, 2015

@headius Thanks for reviewing. I just pushed.

enebo added a commit that referenced this pull request Feb 2, 2015
Fix for issue 2182 on jruby-1_7 : Struct#inspect with utf8 encode string member
@enebo enebo merged commit 68bf136 into jruby:jruby-1_7 Feb 2, 2015
@enebo enebo added this to the JRuby 1.7.20 milestone Feb 2, 2015
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.

None yet

4 participants