fast_xs icon indicating copy to clipboard operation
fast_xs copied to clipboard

to_xs has changed in builder 3 fast_xs should deal with it

Open SamSaffron opened this issue 14 years ago • 2 comments

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

SamSaffron avatar Oct 01 '11 15:10 SamSaffron

at the moment fast_xs blows up on an instruct! in rails 3.1

SamSaffron avatar Oct 01 '11 15:10 SamSaffron

Yes problem is little but annoying. Please fix it.

rubydog avatar Mar 21 '12 07:03 rubydog