title: How to set MediaType to UTF-8 in restTemplate with json format
body: <p>I have one problem that I can't convert the data in json format to UTF-8 when the server response. I have set <code>MediaType</code> in spring configuration xml, but it seems not work. And here is my server side code to response:</p>
  
  <pre><code>    @RequestMapping(value = "/post",  method = RequestMethod.POST)
      public @ResponseBody String postData(@RequestBody ObjectNode request){
          // do something with request
          return response;
      }
  </code></pre>
  
  <p>When server response, data in json format will contain value as unicode. And in client side configuration:</p>
  
  <pre><code>    &lt;bean id="restTemplate" class="org.springframework.web.client.RestTemplate"&gt;
        &lt;property name="messageConverters"&gt;
          &lt;list&gt;
              &lt;bean id="formConverter" class="org.springframework.http.converter.FormHttpMessageConverter" /&gt;
              &lt;bean id="stringConverter" class="org.springframework.http.converter.StringHttpMessageConverter" /&gt;
              &lt;bean id="jsonConverter" class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter" &gt;
                  &lt;property name="supportedMediaTypes"&gt;
                        &lt;list&gt;
                          &lt;bean class="org.springframework.http.MediaType"&gt;
                             &lt;constructor-arg value="application" /&gt;
                             &lt;constructor-arg value="json" /&gt;
                             &lt;constructor-arg value="#{T(java.nio.charset.Charset).forName('UTF-8')}"/&gt;
                           &lt;/bean&gt;
                        &lt;/list&gt;
                  &lt;/property&gt;
              &lt;/bean&gt;
          &lt;/list&gt;
        &lt;/property&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <p>And here is my client side code to request for data, and I use postForObject method:</p>
  
  <pre><code>    @Autowired
      private RestTemplate restTemplate;
  
      public ObjectNode postObjectNode(ObjectNode request){
            ObjectNode node = restTemplate.postForObject("http://localhost:8080/server/post", request, ObjectNode.class);
            return node;
  }
  </code></pre>
  
  <p>And as a result, data that contain the unicode will convert to <code>????</code>. Is it cause by server or cause by restTemplate client. please help me. Thanks in advance...</p>