I think I have a serious problem concerning the collation of my page in connection with the BOM. After checking my page with the w3 validator I saw that at the beginning of my head.php a BOM is showing up. Problem is, after I saved my head.php in utf-8 without BOM (before it was just utf-8) all input on all pages gets messed up. More specifically the mutated vowels (äöüß etc) are now shown as ö, ä, ß and so on. How is that possible? I have actually set and saved everything to utf-8.
I have saved every page of my website as utf-8 without BOM.
The collation of my server manager on the FTP-Server is set to "utf-8". The charset of my head.php is set to utf-8:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
The connection to my DB via PDO is set in utf-8:
$dsn = 'mysql:host=' . $this->host . ';dbname=' . $this->dbname . ';charset=utf8';
// Set options
$options = array(
PDO::ATTR_PERSISTENT => true,
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'"
);
The collation of my databank and the data-table is set to utf8_unicode_ci
.
Does someone have an idea what I can do here or where I can start looking for the problem?
EDIT: I just cannot find a mistake here. Created a simple .php file with plain text and set it the following:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
and saved it with "utf-8 without BOM". Also checked on the text with
<?php echo "encoding:". mb_detect_encoding("öäü"); ?>
and it says: UTF-8. But still, mutated vowels are like ö, ä, ß... I really don't know what to do here.