title: Using Apache URIBuilder '&' symbol in the query parameter gets encoded twice
body: <p>I am trying to hit a webservice URL with a query parameter as foo &amp; bar with the URL as encoded. To achieve encoding, I am using Apache URIBuilder. The code is as follows:</p>
  
  <pre><code>URIBuilder ub = new URIBuilder("http://example.com/query").setParameter("q", "foo &amp; bar");
              URI uri = ub.build();
              HttpGet httpget = new HttpGet(uri);
              System.out.println(httpget.getURI());
  </code></pre>
  
  <p>I get the following as output: <a href="http://example.com/query?q=+foo+%2526+bar" rel="nofollow noreferrer">http://example.com/query?q=+foo+%2526+bar</a></p>
  
  <p>I am new to this JAR file and have 2 questions:</p>
  
  <ol>
  <li><p>Why is the space in the query param replaced with a '+' sign and not with %20 special character.</p></li>
  <li><p>Why is the '&amp;' symbol in the query param getting encoded twice and how to avoid it.</p></li>
  </ol>