I am working on an API Rest with Symfony 2.8. I have been given the following case: when they make a request to the URL /search
, this usually comes:
http://{servidor.com}/search/libros?q=vacaciones&language=es
the request is handled in the controller in this way:
public function searchAction($elemento, ParamFetcherInterface $paramFetcher){
$q = $paramFetcher->get('q');
// ... demas proceso, haciendo consulta a bbdd
Recently I have found myself asking this request:
http://{servidor.com}/search/libros?q=democr%C3%A1tico&language=es
and when I do a var_dump ($ q) on the controller, I find that $ q is democratic .
This seems to be a problem of character conversion, utf8 or something similar.
Of course, I understand that the request is incorrect, but I have been asked to correct this problem in my application in the meantime. However, I can not find configuration or conversion form. In addition, although the request is worth democr%C3%A1tico
, when it arrives at the controller it is already transformed with the characters á
.
I guess you can change the configuration of the FosRestBundle but in the official documentation not nothing appears about utf8. Does this problem sound to someone? Can you help me?