I am trying to scrape a webpage in arabic and everything works fine except the fact that when i echo the text what i get is a garbled up text even though i have set the header to UTF-8
Here is my code
<?php
header ('Content-Type: text/html; charset=UTF-8');
require 'vendor/autoload.php';
use Goutte\Client;
$client = new Client();
$crawler = $client->request('GET', 'http://www.lebanonfiles.com');
$news_container = $crawler->filter('#mcs4_container .line');
$news_container->each(function($node) {
echo $node->text();
})
?>