I am using this code in order to show data onto php page:
$url = 'http://example.com';
//Initiate cURL and pass it the URL we want to retrieve.
$ch = curl_init($url);
//Tell cURL to return the output as a string.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
//Execute the cURL request and return the output to a string.
$response = curl_exec($ch);
//Print out the response to the browser.
echo mb_detect_encoding($response);
echo utf8_encode($response);
The last two lines contain debugging methods I've tried lastly. Mb_detect_encodign returns UTF-8 at my content, even if the original source URL is including windows-1253 encoding in its charset.
The content is not being displayed correctly - It returns characters like: õìðëçñþóôå instead of the original content which is expected in greek characters.
I know that Windows-1253 is not supported by PHP, however, it seems that phpcurl is transforming it to UTF8 - but in my case, its not being done correctly.
I tried adding a php header with no luck. Also tried adding mb_convert_encoding with no luck aswell.
Any advises?