We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

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.2k
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/