I think `URI.escape` is fundamentally broken, and it is now [deprecated](https://groups.google.com/d/topic/ruby-core-google/kqxvI9f6h-U/discussion). The problem is that it doesn't escape reserved characters as defined in http://tools.ietf.org/html/rfc3986:

<pre>
   reserved      = gen-delims / sub-delims
   gen-delims    = ":" / "/" / "?" / "#" / "[" / "]" / "@"
   sub-delims    = "!" / "$" / "&" / "'" / "(" / ")"
                 / "*" / "+" / "," / ";" / "="
</pre>

So for example, '+' should be escaped, but isn't:

<pre>
irb(main):017:0> URI.escape '+'
=> "+"
</pre>

However, you can use `CGI.escape` which makes the expected translations:

<pre>
irb(main):013:0> CGI.escape ":/?#[]@!$&'()*+,;= \"{}"
=> "%3A%2F%3F%23%5B%5D%40%21%24%26%27%28%29%2A%2B%2C%3B%3D+%22%7B%7D"
</pre>

So my recommendation is to use `CGI.escape` instead.