AddDefaultCharset is used when the response header content type is text / plain or text / html
In .htaccess or httpd.conf you can add:
AddDefaultCharset utf-8
AddCharset is a character set definition for any given file extension.
In .htaccess or httpd.conf you can add:
AddCharset utf-8 .html .css .php .txt .js
In PHP (before outputting any page content):
<?php header('Content-Type: text/html; charset=utf-8');
If you use the HTML meta tag (cannot edit config or htaccess), this should be the first thing that follows the <head>
Link: Best Practice: Get your HEAD in order
<head><meta http-equiv="content-type" content="text/html; charset=UTF-8">
source share