views:

105

answers:

2

And which one should I use?

+3  A: 

URI.escape takes a second parameter that lets you mark what's unsafe. See APIDock:

http://apidock.com/ruby/CGI/escape/class

http://apidock.com/ruby/URI/Escape/escape

rspeicher
+1  A: 

There were some small differences, but the important point is that URI.escape has been deprecated in Ruby 1.9.2... so use CGI::escape! :-)

There is a long discussion on ruby-core for those interested.

Marc-André Lafortune