Twig replaces non-ascii characters with entities

做~自己de王妃 提交于 2019-12-02 09:47:48

Hi if the caracters are in a variable it's normal, to disabled you can use :

{{myvar | raw}}

Source if you need : http://twig.sensiolabs.org/doc/filters/raw.html

Twig uses different autoescaping strategies based on the context. See manual http://twig.sensiolabs.org/doc/tags/autoescape.html

You can force Twig to disable escaping with:

{% autoescape false %}
    Everything will be outputted as is in this block
{% endautoescape %}

Or for a single print expression with raw filter:

{{ var|raw }}

Also have a look at your Twig 's configuration where autoescaping should be enabled by default.

Edit:

Maybe try also this:

<script>
    {% autoescape false %}
        $(function(){
            alert('ółż');
        })
    {% endautoescape %}
</script>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!