views:

155

answers:

1

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