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?
html()andh()are common. Usinghtmlspecialchars()would eschew the charset issue and be compliant to the older xhtml syntax. (But better use the charset parameter for reliability).