It looks like you have UTF-8 encoded strings internally, PHP outputs them properly, but your browser fails to auto-detect the encoding (it decides for ISO 8859-1 or some other encoding).
The best way is to tell the browser that UTF-8 is being used by sending the corresponding HTTP header:
header("content-type: text/html; charset=UTF-8");
Then, you can leave the rest of your code as-is and don't have to html-encode entities or create other mess.
If you want, you can additionally declare the encoding in the generated HTML by using the <meta>
tag:
<meta http-equiv=Content-Type content="text/html; charset=UTF-8">
for HTML <=4.01<meta charset="UTF-8">
for HTML5
HTTP header has priority over the <meta>
tag, but the latter may be useful if the HTML is saved to HD and then read locally.