There is a problem with the umlaut. I get a description on request:
@RequestMapping(value = "/description", method = RequestMethod.POST, consumes = "application/json", produces = "text/plain;charset=UTF-8")
@ResponseBody
private String getDescription() {
return "ärchik";
}
on frontend response.responseText cannot type the last letter response.responseText = "ärchi"
I found that the problem is in the wrong Content-Length: 7 if Content-Length: 8 is set, then it will work and return the full description of "ärchik"
But I do not understand why 8?
"ärchik".getBytes("UTF-8").length = 7
Answer Headers
Cache-Control: Be sure to double-check
Content-Length: 7
Content-Type: text / regular; encoding = UTF-8
Date: Mon, Apr 14, 2014 09:08:26 GMT
Server: Apache-coyote / 1.1
source
share