title: Read non english UTF-8 content from HTTP request
body: <p>I have below code. </p>
  
  <p>Content is coming in request which is non english and UTF-8 encoded. How to read it ? Currently i am doing this but looks like it is not correct. </p>
  
  <p>private String readContent(HttpServletRequest request) throws IOException {</p>
  
  <pre><code>String body = null;
  BufferedReader reader = null;
  
  if (logger.isDebugEnabled()) {
      logger.debug("Inside readContent() ...");
  }
  
  try {
      // Read from request
      StringBuilder buffer = new StringBuilder();
      reader = request.getReader();
      String line;
      while ((line = reader.readLine()) != null) {
          buffer.append(line + "\n");
      }
  
  //  if (body != null) {
          body = buffer.toString();
          body.trim();
  //  }
  
  } catch (IOException ex) {
      throw ex;
  } finally {
      if (reader != null) {
          try {
              reader.close();
          } catch (IOException ex) {
              throw ex;
          }
      }
  }
  
  if (logger.isDebugEnabled()) {
      logger.debug("Leaving readContent() ..." + body);
  }
  return body;
  </code></pre>
  
  <p>}</p>