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

Problem with UTF-8 Encoding

Where can I set the enconding in phalcon ? I always get � when I try to print latin chars like é,è,á I already tried to set <meta charset="UTF-8"> in volt index layout. I build the project using phalcon-tools. Thanks.



26.3k
Accepted
answer
edited Aug '14

Which text editor do you use?

Proper chars printing depends not only from charset settings in the code but from the file itself. E.g I am using Notepad++ and in order to have my files saved properly in UTF-8 you need to choose from menu: Encoding -> Encode in UTF-8 without BOM.

Always choose without BOM option.

To sum up, one of the reason why you get strange chars is that your files are not saved/edited/created in UTF-8 which is fault of your text editor.

It solved my issue, thank you o/