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

Differences between XML string encoding in MRI and JRuby #561

Closed
dalton opened this Issue Mar 5, 2013 · 3 comments

Comments

Projects
None yet
5 participants
@dalton
Copy link

dalton commented Mar 5, 2013

I'd like to use JRuby to create some XML files, but it is not escaping characters in the same way MRI Ruby does.

> "<node attr=#{'this is "my" complicated <String>'.encode(:xml => :attr)} />"

MRI

  ruby-1.9.3-p194 => "<node attr=\"this is &quot;my&quot; complicated &lt;String&gt;\" />"

JRuby

  jruby-1.7.2 => "<node attr=this is \"my\" complicated <String> />"

This is a contrived example to show the differences between the two Ruby implementations of String#encode(:xml => [attr|text]).

@enebo

This comment has been minimized.

Copy link
Member

enebo commented Mar 5, 2013

Yeah. Unfortunately, this is a known problem. We accept the option but it is current unimplemented. I do think we have an issue open for this but I cannot locate it atm (so I will leave this open). The good news is that some recent refactoring will make fixing this a little bit easier, but we are not specifically working on it. For sure if this is not addressed for 1.7.4 it will be for 1.7.5.

@retoo

This comment has been minimized.

Copy link
Contributor

retoo commented May 16, 2013

@tychobrailleur

This comment has been minimized.

Copy link
Contributor

tychobrailleur commented May 16, 2013

This was fixed by #684 and should be available in 1.7.4.

@atambo atambo closed this May 17, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.