I'm having a really hard time trying to replace a certain character with it's entity equivalent. I tried to str_replace the character "ā" but it just wont work! I can't see why. The code I use:
$content = str_replace('ā', 'ā',$content);
If anyone has some tips or maybe even an explanation of why it doesn't work, please let me know!
UPDATE:
While above code doesn't replace the character with the entity (don't understand why) that is not the main problem. The character shows up fine, but when I read this page using file_get_contents and after that insert the read HTML into a database the character gets mangled. It's already mangled in the database in which it was inserted.
All headers as suggested below are UTF-8, database tables have UTF-8 encoding, files are UTF-8...
As a quick fix I wanted to convert the char to it's entity before insert into that DB.