title: I am trying to recieve text in any language from JSP and save it into the data base
body: <p>I am trying to recieve text in any language from JSP and save it into the data base. While I am debugging I can see that the text has been recieved in the servlet but when I am printing the same variable I get ?????.  I tried to save the text in a static variable and tried to print it.
  String a="नमस्ते";
  System.out.print(a).</p>
  
  <p>When I did this inside the doPost method I get ???? in the console.
  But in the same servlet if I write a main method and do it I am getting the expected output.
  I have set my request and response type to UTF-8.</p>
  
  <p>Here is my code       </p>
  
  <pre><code>        protected void doPost(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException {
          response.setContentType("application/json;charset=UTF-8");
          response.setCharacterEncoding("UTF-8");
          request.setCharacterEncoding("UTF-8");
        try {
  
          String feedBack = null, prob = null;
          String a = "नमस्ते";
          System.out.println(a);
          feedBack = request.getParameter("feedback");
          System.out.println("Feedback is " + feedBack);
          System.out.println("Feedback is " + a);
          LogOut.log.error("In FeedbackServlet " + e);
      }
      catch(Exception e)
      {
      }
  
      public static void main(String[] args) {
      String a = "नमस्ते";
               System.out.println(a);
  }
  </code></pre>
  
  <p>In the main function I am getting the hindi letters on the console and when the doPost is executed I am getting ???? in the console for the variable a.</p>