I am doing a query in a sqlserver database with PHP / PDO then return a JSON to search in Angular JS.
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
$json = json_encode($result);
print $json;
However, the values it contains, for example:
string(17) "Iniciou Inscri��o"
In JSON it returns as null
. My possible solutions include:
header('Content-Type: application/json; charset=utf-8');
json_encode($result, JSON_UNESCAPED_UNICODE)
None of them resolved. Does anyone have a solution?