How do I set character encoding to UTF-8 for default.html?

You need to replace the HTTP-level header.

This should work:

    header('Content-type: text/html; charset=utf-8');

Note that the above must be the first thing in your file. No exceptions. See header.

For general information on how to change the character set header in different web stacks, see Setting the HTTP charset parameter.

Leave a Comment