Alex Rivera | Logout

Twig UTF8 Character Encoding - Symfony2

Asked 2011-06-11T00:27:24.690
14

I am developing a news system for a french association's website with Symfony2. I'm having troubles when it comes to displaying the accents and also HTML.

In the twig view I simply output the variable:

{{ article.body }}

If I insert the accent directly in the database like this: 'é', the variable is not even displayed.

If I insert this instead: é it stays the same.

HTML is shown as text.

I also tried the autoescape function (set to true and false), no success :

{% autoescape true %}
    {{ article.body }}
{% endautoescape %}

Any suggestions? Thanks a lot

Edit
Report

1 Answer

0

Try this, if you have in the ddbb something like this

árbol

{% autoescape %}
  {{ c.data|raw }}
{% endautoescape %}

This will show

árbol
answered 2012-12-10T02:36:56.980

Your Answer