Basically url escapes a string except uses '+' instead of '%20' for spaces.
+2
A:
CGI::escape
does just that:
irb(main):003:0> require 'cgi'
=> true
irb(main):004:0> CGI::escape("foo and/or bar")
=> "foo+and%2For+bar"
Mark Rushakoff
2010-03-28 14:16:16