[SOLVED] - PDO Message: Malformed UTF-8 characters, possibly incorrectly encoded

Posted 2 years ago

If you’re seeing the below error when working with PDO, I recently run into the same issue, this was down to the charset on the initiation of PDO.

Message: Malformed UTF-8 characters, possibly incorrectly encoded

Adding in charset=utf8 should solve this issue.


'mysql:host=' . $this->host . ';dbname=' . $this->dbname . ";charset=utf8"