fast_xs
fast_xs copied to clipboard
to_xs has changed in builder 3 fast_xs should deal with it
class String
# XML escaped version of to_s. When <tt>escape</tt> is set to false
# the CP1252 fix is still applied but utf-8 characters are not
# converted to character entities.
def to_xs(escape=true)
unpack('U*').map {|n| n.xchr(escape)}.join # ASCII, UTF-8
rescue
unpack('C*').map {|n| n.xchr}.join # ISO-8859-1, WIN-1252
end
end
at the moment fast_xs blows up on an instruct! in rails 3.1
Yes problem is little but annoying. Please fix it.