title: Convert encoded string to readable string in java
body: <p>I am trying to send a POST request from a C# program to my java server.
  I send the request together with an json object.
  I recive the request on the server and can read what is sent using the following java code:</p>
  
  <pre><code>BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
  OutputStream out = conn.getOutputStream();
  String line = reader.readLine();
  String contentLengthString = "Content-Length: ";
  int contentLength = 0;
  while(line.length() &gt; 0){   
      if(line.startsWith(contentLengthString))
          contentLength = Integer.parseInt(line.substring(contentLengthString.length()));             
      line = reader.readLine();
  }       
  char[] temp = new char[contentLength];
  reader.read(temp);  
  String s = new String(temp);
  </code></pre>
  
  <p>The string s is now the representation of the json object that i sent from the C# client. However, some characters are now messed up.
  Original json object:</p>
  
  <pre><code>{"key1":"value1","key2":"value2","key3":"value3"}
  </code></pre>
  
  <p>recived string:</p>
  
  <pre><code>%7b%22key1%22%3a%22value1%22%2c%22key2%22%3a%22value2%22%2c%22key3%22%3a%22value3%22%%7d
  </code></pre>
  
  <p>So my question is: How do I convert the recived string so it looks like the original one?</p>