1
I’m using one of the recommended Ibraries in this answer, Querypath. To get the data I’m using Guzzle.
However, I am having problems in the return of data (accentuation), it is replacing the characters by ?
.
OBS: The problem is not in the Guzzle
, because I tested with another parser, that according to the above answer is not one of the recommended... and also did not continue its use by not meet some complex html’s that I need to treat... but the fact is, that it returned the accent correctly.
Tested solutions without success:
//Primeira Tentativa
$content = mb_convert_encoding($resposta->getBody()->getContents(), 'UTF-8', 'auto');
$html = htmlqp($content); // Problema acentuação ?????????
//Segunda Tentativa
$html5 = new HTML5();
$content = $html5->loadHTML($resposta->getBody()->getContents());
$html = htmlqp($content); // Problema acentuação ?????????
//Terceira Tentativa
$qp = html5qp($resposta->getBody()->getContents());
//Quarta Tentativa
$options = ['convert_to_encoding' => 'UTF-8'];
$qp = htmlqp($resposta->getBody()->getContents(), null, $options);
I no longer know what to test.... What could be?