We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Tag::displayTo utf8 encoding is not correct!

Tag::displayTo('name','你好'); output below: 西安立免&#x7f51 This is not the result i wanted.



98.9k
Accepted
answer

Data is automatically escaped preventing XSS attacks, if you want to disable it is up to you

Phalcon\Tag::setAutoescape(false);


32.2k

I ran into this issue today. I'm using UTF-8 strings and it doesn't do a good job with non-ascii characters. I had to turn off auto escape. Which function is being used for escaping? Characters like á à é ó ú all become �. Why is that?