Htmlentities Converts Trademark Into �
Possible Duplicate: PHP htmlentities() not working as expected I am using htmlentities to convert a trademark symbol into the htmlentity, but it is giving me â�&
Solution 1:
According to the manual, when not feeding this function with ISO-8859-1 strings, you need to provide a charset:
echo htmlentities($row['name'], ENT_QUOTES, 'UTF-8');
Update March 2015: Note that since this answer, the default character set this function uses has been changed for different versions:
- PHP < 5.4:
ISO-8859-1
- PHP 5.4 & 5.5:
UTF-8
- PHP >= 5.6: the
default_charset
setting (which is very welcome, and how it should have been in the first place).
Post a Comment for "Htmlentities Converts Trademark Into �"