title: Encode URL query parameters
body: <p>How can I encode URL query parameter values? I need to replace spaces with <code>%20</code>, accents, non-ASCII characters etc.</p>
  <p>I tried to use <code>URLEncoder</code> but it also encodes <code>/</code> character and if I give a string encoded with <code>URLEncoder</code> to the URL constructor I get a <code>MalformedURLException</code> (no protocol).</p>