title: trying to URIEncode a string in java using URIUtils
body: <p>I'm trying to URIENcode a string in java using URIUtils of spring framework.</p>
  
  <p>it supposed to be simple as far as I understood but for some reason the string stays unchanged.</p>
  
  <p>I have the following string:</p>
  
  <pre><code>http://www.foo.bar/foo/bar
  </code></pre>
  
  <p>and I want to URIEncode it.</p>
  
  <pre><code>final String ENC = "UTF-8";
  String uri = "http://www.foo.bar/foo/bar";
  final String result = UriUtils.encodeFragment(uri, ENC);
  </code></pre>
  
  <p>the result is the same string not encoded.</p>
  
  <p>what am I doing wrong?</p>
  
  <p>how can I properly URIEncode that string in order to use it in get parameters ?</p>
  
  <p>I don't want to use a URLBuilder because i need to use the resulted output and create a hash table for an internal database.</p>
  
  <p>thank you</p>