Json Internet Explorer 中的响应问题

Json response issue in Internet Explorer

我在 Internet Explorer 中使用 ajax 显示 json 响应时遇到问题。其他浏览器正确显示它。但在 Internet Explorer 中显示为 ??????。

响应 Header 是

Key Value
Response    HTTP/1.1 200 OK
Server  Apache-Coyote/1.1
Pragma  no-cache
Cache-Control   private, max-age=0, no-store, no-cache
Expires Fri, 22 Jan 2016 03:50:17 GMT
Cache-Control   no-cache, no-store, max-age=0, must-revalidate
Pragma  no-cache
Expires 0
X-XSS-Protection    1; mode=block
X-Frame-Options SAMEORIGIN
X-Content-Type-Options  nosniff
Content-Type    text/html;charset=UTF-8
Content-Length  145
Date    Fri, 22 Jan 2016 03:50:17 GMT

但在 Internet Explorer 中响应 body 给出为

 {"data":null,"status":2,"message":"Request succeeded","errors":{"data1":"??????????????","data2":"??????????????"}}

在所有其他浏览器中都能正确显示

我已经找到了答案。这是服务器的问题。我们必须在服务器中将响应内容类型设置为 text/plain。以下是我解决问题的代码。

   @RequestMapping(value = "/uploading", method = RequestMethod.POST, produces = "text/plain;charset=UTF-8")
public @ResponseBody
String upload(@RequestParam(value = "file", required = false) MultipartFile file, Locale locale) {
//opertions here
return jsonSerializer.serialize(message);
}

有关详细信息,请查看 link UTF-8 encoding problem in Spring MVC