I'm getting xml file which I need to handle in my SpringBoot Rest controller. But I have problem with parsing cyrillic chars. In my controller these symbols look like this: d�鲲㮮弯.
I was trying to decode using
new String(xmlstring.getBytes("UTF-8"), "Windows-1251")
Also I was trying add to my controller:
consumes = "application/json; charset=UTF-8"
Top of my controller looks like this:
@PostMapping(value = "/endpoint", produces = "text/xml; charset=windows-1251", consumes = "application/json; charset=UTF-8")
@ApiOperation("...")
public ResponseEntity<String> get(@RequestBody String xml)
I need to parse that to standart cyrillic shape. Thank you.