dimanche 16 août 2015

Receive wrong representation of non-unicode characters in request to controller ("Ðо" instead of "Сыр")

Here is my controller:

@RequestMapping(value = "/item/products", method = RequestMethod.GET)
@ResponseBody
public ProductDto[] getProducts(Pageable pageable, @RequestParam(value = "searchDto", required = false) String serializedDto) throws IOException {

I send this request:

http://...item/products?page=0&size=10&sort=status,asc&sort=id,asc&searchDto={"name":"Сыр"}

"Сыр" - Cyrillic

And in controller I receive this:

serializedDto = {"name":"Ðо"}

instead of this:

serializedDto = {"name":"Сыр"}

Problem is in encoding, I have tried a lot of things but they didn't work. What I'm doing wrong? If you need more code/materials I will provide it.




Aucun commentaire:

Enregistrer un commentaire