title: In a URL, should spaces be encoded using %20 or +?
body: <p>In a URL, should I encode the spaces using <code>%20</code> or <code>+</code>? For example, in the following example, which one is correct?</p>
  
  <pre><code>www.mydomain.com?type=xbox%20360
  www.mydomain.com?type=xbox+360
  </code></pre>
  
  <p>Our company is leaning to the former, but using the Java method <a href="http://docs.oracle.com/javase/8/docs/api/java/net/URLEncoder.html#encode-java.lang.String-java.lang.String-" rel="noreferrer"><code>URLEncoder.encode(String, String)</code></a> with <code>"xbox 360"</code> (and <code>"UTF-8"</code>) <a href="http://ideone.com/5eLild" rel="noreferrer">returns the latter</a>.</p>
  
  <p>So, what's the difference?</p>