If you run into this strange issue when trying to json encode data got from database, you probably should check the character set of your database connection.

With PDO can set the connection character set using 'MYSQL_ATTR_INIT_COMMAND' while connecting the database. Below is the same code,

$dbh = new PDO('mysql:host=MYSQL-SERVER-HOSTNAME;dbname=DATABASE-NAME', 'YOUR-DB-USERNAME', 'YOUR-DB-PASSWORD', array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'UTF8'"));