title: java.net.URLEncoder/Decoder alternatives
body: <p>I found <a href="https://www.owasp.org/index.php/ESAPI_Secure_Coding_Guideline#Banned_APIs" rel="nofollow"> here </a> that java.net.URLEncoder/Decoder shouldn't be used and instead of that, Encoder.encodeForURL()/decodeForURL() should be used. But I'm unable to find proper usage examples on the internet.
  I'm curious about the reason what is the problem with URLEncoder or decoder. Kindly also tell how to use these functions.</p>
  
  <p>I know that URLEncoder/decoder functions which take single arguments are deprecated because they don't take the character encoding format. But what is the problem with, say, something like this?</p>
  
  <pre><code>String decoded = java.net.URLDecoder.decode(URL, "UTF-8");
  </code></pre>