Hindi text not displayed correctly
<p>I am developing a Text to speech website for Hindi language only. But I am getting the following problem and have been unable to find an appropriate solution. </p>

<p>Input: <strong>102 सुरंगों</strong>
(for example)</p>

<p>Output: <strong>(एक सौ दो)_NSW à¤¸à¥à¤°à¤à¤à¥à¤</strong> </p>

<p>While the numerical part has been correctly interpreted, the text is wrongly processed. Also, the input changes to the following: <strong>102 à¤¸à¥à¤°à¤à¤à¥à¤</strong></p>

<p>The correct output must be: <strong>(एक सौ दो)_NSW सुरंगों</strong></p>

<p>This is the code in index.jsp that is called on button click.</p>

<pre><code>function submitPreprocessForm() {

 var postData=$("#maryWebClient").serializeArray();

 $.ajax({
     url: "preprocess",
     context:this,
     type:"POST",
     dataType:"json",
     data:postData,

     success: function(response){
         $("#INPUT_TEXT").val(response["x"]);
         $("#INPUT_TEXT2").val(response["y"]);
     },
             error: function(errorData){alert(errorData);}
 });}
</code></pre>

<p>And this is the module (part of it) called using urlPatterns for displaying preprocessed text :</p>

<p>Preprocessor.java</p>

<pre><code>protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException, Exception {
        response.setContentType("application/json;charset=utf-8");
        PrintWriter out=response.getWriter();

        String sent=request.getParameter("INPUT_TEXT");
        sent=sent.trim();
        NewJFrame2 njf=new NewJFrame2();  
        String p=njf.read(sent);

        Map m1 = new HashMap(); 
         m1.put("x", sent);
         m1.put("y", p);

        Gson gson = new Gson();
        String json = gson.toJson(m1);
        System.out.println(json);
        out.write(json);
        out.close();
    }
</code></pre>

<p>Kindly guide me to my mistake. </p>

<p>NOTE: I have checked the encoding in the NetBeans project properties and in web.xml. Both are set correctly to "UTF-8".</p>