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

append19 being called when running in 1.8 mode with jruby 1.7.0 #366

Closed
atambo opened this Issue Oct 30, 2012 · 3 comments

Comments

Projects
None yet
2 participants
@atambo
Member

atambo commented Oct 30, 2012

I'm getting the following stacktrace when running a rails app with jruby 1.7.0 with 1.8 mode enabled:

https://gist.github.com/3981779

It looks like RuntimeHelpers#shortcutAppend always calls append19 even in 1.8 mode and causes a newEncodingCompatibilityError:

https://github.com/jruby/jruby/blob/master/src/org/jruby/javasupport/util/RuntimeHelpers.java#L2765

@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius Oct 31, 2012

Member

Interesting! I think you're right...it should be calling the 1.8 version of the method.

Member

headius commented Oct 31, 2012

Interesting! I think you're right...it should be calling the 1.8 version of the method.

@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius Oct 31, 2012

Member

I am about to commit a fix, but do you have any way for me to reproduce this? We'd like to include a test for it, naturally.

Member

headius commented Oct 31, 2012

I am about to commit a fix, but do you have any way for me to reproduce this? We'd like to include a test for it, naturally.

@headius headius closed this in 47a88ba Oct 31, 2012

@atambo

This comment has been minimized.

Show comment
Hide comment
@atambo

atambo Oct 31, 2012

Member

I can reproduce the issue by running the following code in rails console:

helper.content_tag(:div, "München".to_java, {:attribute => "München"})

The implementation of content_tag is here:

https://github.com/rails/rails/blob/v3.2.8/actionpack/lib/action_view/helpers/tag_helper.rb#L92

I've tried to reproduce the error without calling content_tag but I haven't had any luck.

Member

atambo commented Oct 31, 2012

I can reproduce the issue by running the following code in rails console:

helper.content_tag(:div, "München".to_java, {:attribute => "München"})

The implementation of content_tag is here:

https://github.com/rails/rails/blob/v3.2.8/actionpack/lib/action_view/helpers/tag_helper.rb#L92

I've tried to reproduce the error without calling content_tag but I haven't had any luck.

prathamesh-sonpatki added a commit to prathamesh-sonpatki/jruby that referenced this issue Dec 3, 2012

Fix #366
DNode logic was always calling the 1.9 version of String#append
even in 1.8 mode. For badly-encoded or mixed-encoding text, this
could cause a failure due to 1.9's more-strict encoding checks. I
modified the logic to call the version-specific append function
and added the same type-specific logic in that append.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment