This question already has an answer here:
I have the following function;
function generateFirstName(){
$firstNameArray = array("Thomáš ","Lukáš ");
$firstNameKey = mt_rand(0,1);
$firstName = $firstNameArray[$firstNameKey];
return $firstName;
}
When the function is called on the same page the UTF-8 format outputs fine, but when it is called from a functions.php (that is REQUIRED in the INCLUDED head.php) the UTF-8 format doesn-t arrive and i get the dreaded black diamond with white question mark.
What do I need to do to pass the strings?
</div>
Check every required or included files encoding. They all must be in UTF-8 to work together. You have to be sure about every file, that can be included from functions.php and other files.
Each file must be encoded in utf8