I have a database where I need to display the records for the user. I am using htmlentities to make sure no malicious code is being echoed to the user like this:
function h($string) {
return htmlentities($string, ENT_SUBSTITUTE, "UTF-8");
}
then calling the function whenever I output any entries to the user. The problem is that I need to be able to show the Danish characters ÆØÅ and these characters displays as a question mark in a square. The site has utf-8 encoding as well.
I have tried all that is listed under htmlentities on php.net and tried finding some solution for creating exceptions or another work around, but I have been unable to find any.
Does anybody know a workaround for this issue?