Im trying to show a text like this:
1ºA
stored in a MySQL table ('level').
After querying the table 'level' using this code:
/**
 * @Route("/list-level", name="list_level")
 */
public function listAction(Request $request)
{
    $em = $this->getDoctrine()->getEntityManager();
    $levels = $em->getRepository('AppBundle:Level')->findAll();
    var_dump($levels[0]->getName());
    die("fasf");
the var_dump() returns this:
Im using Symfony, so the information related to database connection is  cached in the file var/cache/prod/appProdProjectContainer. So I have opened it to check the value of charset parameter and I have found this:
protected function getDoctrine_Dbal_DefaultConnectionService()
{
    $a = new \Symfony\Bridge\Doctrine\ContainerAwareEventManager($this);
    $a->addEventListener(array(0 => 'loadClassMetadata'), ${($_ = isset($this->services['doctrine.orm.default_listeners.attach_entity_listeners']) ? $this->services['doctrine.orm.default_listeners.attach_entity_listeners'] : $this->get('doctrine.orm.default_listeners.attach_entity_listeners')) && false ?: '_'});
    return $this->services['doctrine.dbal.default_connection'] = ${($_ = isset($this->services['doctrine.dbal.connection_factory']) ? $this->services['doctrine.dbal.connection_factory'] : $this->get('doctrine.dbal.connection_factory')) && false ?: '_'}->createConnection(array('driver' => 'pdo_mysql', 'host' => 'localhost', 'port' => NULL, 'dbname' => 'my_javiergarpe1979', 'user' => 'javiergarpe1979', 'password' => '*******', 'charset' => 'UTF8', 'driverOptions' => array(), 'defaultTableOptions' => array()), new \Doctrine\DBAL\Configuration(), $a, array());
}
As you can see on that function there is written this: 'charset' => 'UTF8', so.. why am I not getting the correct caracters?

 
     
     
     
    