Reputation: 12036
Why html_entity_decode()
decodes "ó" to unknown character?
echo "ó -> ".html_entity_decode('ó');
Gives the following result:
ó -> �
in raw format (not interpretated by browser):
ó -> �
Charset is UTF8.
Upvotes: 0
Views: 3860
Reputation: 9765
That's because of default encoding which is ISO-8859-1
(for PHP before 5.4). Set it to UTF-8
in third argument of html_entity_decode
.
Upvotes: 6