I am trying to pull some information via cURL from the post office, however it is returning me but with accent error, would I have some way to change the header that is coming from it to correct this problem of accents?
I'm pulling this way:
<?php
$codigoRastreio = urlencode($_GET['cod']);
$post = array('Objetos' => $codigoRastreio);
// iniciar CURL
$ch = curl_init();
// informar URL e outras funções ao CURL
curl_setopt($ch, CURLOPT_URL, "http://www2.correios.com.br/sistemas/rastreamento/resultado_semcontent.cfm");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_POSTFIELDS, http_build_query($post));
// Acessar a URL e retornar a saída
$output = curl_exec($ch);
// liberar
curl_close($ch);
// Imprimir a saída
echo $output;
?>