title: spring-mvc with resteasy character encoding problem on jetty server
body: <p>I am trying to implement restful protocol on jetty server. I have runnable server and i can access it from my rest client. My server side project is a maven project. I have a problem about the character encoding.When i check response, before send it from controller, there is no encoding problem. But after i return response to client, i see broken data. Response header  is UTF-8. Also i have a listener for this problem and i am setting to request and response to UTF-8. I guess problem happens when i try to write my response data to response.</p>
  
  <pre><code>@GET
  @Path("/")
  @Produces({"application/xml;charset=UTF-8","application/json;charset=UTF-8"})
  public String getPersons(@Context HttpServletRequest request, @Context HttpServletResponse response) {
  
      List&lt;Person&gt; persons = personService.getPersons(testUserId, collectionOption, null);
      if (persons == null) {
          persons = new ArrayList&lt;Person&gt;();
      }
  
      String result = JsonUtil.listToJson(persons);
      //result doesnt has any encoding problem at this line
  
      response.setContentType("application/json");
      response.setContentLength(result.length());
      response.setCharacterEncoding("utf-8");
  
      //i guess problem happen after this line
      return result;
  }
  </code></pre>
  
  <p>Is there any jetty configuration or resteasy configuration for it? Or is there any way to solve this problem? Thanks for your helps.</p>