In my project I currently use htmlentities() to filter data coming from the database:
echo htmlentities($variable_name);
I am in the USA and this works fine for me. My friend is in Brazil and for him some text characters don’t show up correctly.
How can I use htmlentities() so it internationalizes properly?
The problem could be that the output is not encoded in UTF-8. According to the php docs for htmlentities, the function
So you can try calling
instead, and that might fix the problem, since it’s not the default character encoding.