You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have tried to request the document with file_get_contents , encode the result and then pass the result to $web->setContent function, I get the expected output working in this way.
$web = new PHPScraper;
$rawPageContent = utf8_encode(file_get_contents("https://www.marca.com"));
$web->setContent("https://www.marca.com",$rawPageContent);
The text was updated successfully, but these errors were encountered:
ElliotFer2000
changed the title
Spanish web content not displayed correctly ? is putted instead of the correct character
Spanish web content not displayed correctly '?' is putted instead of the correct character
Jul 18, 2023
Spanish words with accents are not properly displayed, char with accents are being replaced with a "?" character
why is this happening? How can I tell the scrapper I'm dealing with the spanish language?
code:
I return the outline back to the client in json format, the result I'm getting is something like this:
I have already tried to solve the problem by putting this at the beggining of the script:
setlocale(LC_ALL, 'es_AR')
F?lix
andopci?n
are not properly displayed in the response, it should beFélix
andOpción
,?
is being showed instead ofé
andó
When I return the result of this function the characters display correctly
utf8_encode(file_get_contents("https://www.marca.com"))
I have tried to request the document with
file_get_contents
, encode the result and then pass the result to$web->setContent
function, I get the expected output working in this way.The text was updated successfully, but these errors were encountered: