title: Android: UTF-8 encoded HTTP response to String
body: <p>I am trying to convert a UTF-8 data to String. The UTF-8 data is obtained by HTTP connection.
  My problem is the converted String does not display UTF-8 Characters properly.</p>
  
  <p>Here is my code {extra bits removed }</p>
  
  <pre><code>URLConnection urlconn = url.openConnection();
  httpConn = (HttpURLConnection) urlconn;
  httpConn.connect();
  InputStream in= httpConn.getInputStream();
  String text = "";
  InputStreamReader isr = new InputStreamReader(in,"UTF-8");
  int charRead;
  char[] inputBuffer = new char[2048];
  
  
  while((charRead = isr.read(inputBuffer))&gt;0){
  String readString = String.copyValueOf(inputBuffer,0,charRead);
  text += readString;
  inputBuffer = new char[BUFFER];
  }
  </code></pre>
  
  <p>Where am i doing wrong ? The generated text is not UTF-8 !!</p>
  
  <p>Thanks</p>