MySQL table name with accent. Invalid utf8 character string when updating via PDO

I’m in a situation where I need to update some rows in a table named “matrĂ­culas’. The query looks something like this:

UPDATE `matrĂ­culas` SET...

When I run this query in my SQL program (HeidiSQL) directly, it executes without problems. When I do it in PHP via a PDO object, I get the following error:

SQLSTATE[HY000]: General error: 1300 Invalid utf8 character string: 'matrxEDculas'

My PDO object is set up like this:

$db= new PDO(

The actual update is done by taking the above query and doing this:

$query = $this->db->prepare($sql);

Both the table and the database were created using the utf8_general_ci collation.

Any ideas what I’m doing wrong? btw, I’m currently testing in Windows in case that has anything to do with it…

Source: stackoverflow-php