From: Brian Candler Date: 2009-05-21T18:59:41+09:00 Subject: Re: gsub choking on fixnum Yukihiro Matsumoto wrote: > The following patch should work. ... > index 2bc0042..a4a30b6 100644 > --- a/lib/rexml/text.rb > +++ b/lib/rexml/text.rb > @@ -286,7 +286,7 @@ module REXML > EREFERENCE = /&(?!#{Entity::NAME};)/ > # Escapes all possible entities > def Text::normalize( input, doctype=nil, entity_filter=nil ) > - copy = input > + copy = input.to_s > # Doing it like this rather than in a loop improves the speed > #copy = copy.gsub( EREFERENCE, '&' ) > copy = copy.gsub( "&", "&" ) ...which was also posted here http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/c2e2f3b9a6ffac50/95e9a6b7bc4ca00f -- Posted via http://www.ruby-forum.com/.