I am trying to get search results from yahoo.com.
But file_get_contents() converts UTF-8 charset (charset, that yahoo uses) content to ISO-8859-1.<
For anyone investigating on this:
The time I spent on encoding issues taught me that rarely php functions "magically" change the encoding of strings. (One of these rare examples is :
exec( $command, $output, $returnVal )
Please note also that the working header set is as follows:
header('Content-Type: text/html; charset=utf-8');
and not:
header('Content-Type: text/html; charset=UTF-8');
As I had a similar issue as the one you describe, it was enough to set the headers properly.
Hope this helps!