Fast_xs inconsistent with MRI implementation

In MRI ruby 1.8.6, we’re seeing this behaviour of the fast_xs method:

require ‘fast_xs’
=> true

" ’ ".fast_xs
=> " ’ "

“”".fast_xs
=> “”"

But in JRuby 1.4RC1, the escaping is different.

jruby-1.4.0RC1 > require ‘fast_xs’
 => true
jruby-1.4.0RC1 > " ’ “.fast_xs
 => " ’ "
jruby-1.4.0RC1 > “””.fast_xs
 => “”"

We would like to achieve the MRI behavior in order to be consistent
with other parts of the code. Where can we modifiy the existing
fast_xs implementation? Or what can we use as an alternative?

Serguei


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

On 8 Oct 2009, at 00:26, Serguei F. wrote:

We would like to achieve the MRI behavior in order to be consistent
with other parts of the code. Where can we modifiy the existing
fast_xs implementation? Or what can we use as an alternative?

Are you using the same version of hpricot in both cases?

Damian


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

I just installed the same version of hpricot that JRuby works with and
I can confirm we are doing something different. I will spend a little
time to try and determine whether this is something in JRuby-proper or
whether this is a bug in the Java native extension of hpricot.

-Tom

On Wed, Oct 7, 2009 at 6:26 PM, Serguei F. [email protected]
wrote:

fast_xs implementation? Or what can we use as an alternative?

Serguei


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


blog: http://blog.enebo.com twitter: tom_enebo
mail: [email protected]


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Ok this is from the fast_xs shipped as part of hpricot:
private static final String[][] APOS_ARRAY = {{“apos”, “39”}, //
XML apostrophe
};

Removing this and a line from a static initializer fixes this, but I
am wondering whether perhaps someone needs to review all of the other
things getting escaped here…When I compare the C extension code to
the Java stuff, the Java stuff has many many more explicit
conversions. I certainly think we are in a position to quickly spin
a new version of hpricot, but someone with more knowledge of what
hpricot should be doing needs to resolve the differences between these
two lists of escaping.

-Tom

On Thu, Oct 8, 2009 at 3:16 PM, Thomas E Enebo [email protected]
wrote:

require ‘fast_xs’
jruby-1.4.0RC1 > " ’ ".fast_xs


blog: http://blog.enebo.com twitter: tom_enebo
mail: [email protected]


blog: http://blog.enebo.com twitter: tom_enebo
mail: [email protected]


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs