title: JQuery ajax char encoding problem to Java servlet
body: <p>I have this bind to my textfields onkeyup event:</p>
  
  <pre><code>function ajaxSearch(sstring,miszerint,startrow,Valid,notValid) {
  setTimeout(function query(){
    if (sstring.length &lt;= 3)
    {
        $("#external").html("&lt;p&gt;min 3 chars please.&lt;/p&gt;")
    }
    else
    {
      $('#loading').ajaxStart(function() {
        $(this).show()
        $("#external").hide()
      });
  
      $('#loading').ajaxComplete(function() {
        $(this).hide()
        $("#external").show()
      });
  
      $.ajax({
          type:"GET",
          url: "/myApp/getStd",
          contentType: "application/x-www-form-urlencoded; charset=UTF-8",
          dataType:"application/x-www-form-urlencoded; charset=UTF-8",
          data:"sstring="+escape(sstring)+"&amp;options="+miszerint+"&amp;startrow="+startrow+"&amp;valid="+Valid+"&amp;notValid="+notValid+"&amp;searchForm=1",
  
                  async: true,
          success: function(data){
          $("#external").html(data);
  
          }
       })
     }
  },1500)
  }
  </code></pre>
  
  <p>The problem is that when I put hungarian chars (e.g., æőűúíéá") into the textfield my servlet returns "�" instead of the provided char.</p>
  
  <p>If I query the servlet directly without ajax it works fine. 
  In the JSP I have defined:</p>
  
  <pre><code>&lt;%@page contentType="text/html" pageEncoding="UTF-8"%&gt;
  </code></pre>
  
  <p>plus</p>
  
  <pre><code>&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  </code></pre>
  
  <p>On the servlet I set the response charset to "UTF-8". Any ideas? </p>