How to use UTF8 in JSON with PHP?

0

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?

    
asked by anonymous 02.06.2016 / 18:02

0 answers