scottmac / opengraph

Helper class for accessing the OpenGraph Protocol
463 stars 151 forks source link

Encoding Issues #15

Open prakash opened 11 years ago

prakash commented 11 years ago

I thought it will handle encoding of Metadata and output it in UTF-8 but sadly it does not. For an example below is my code that does not produce expected response:

<?php
header('Content-Type: text/html; charset=utf-8');
?>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<?php
require('OpenGraph.php');

// Test Domains: tudou.com, baidu.com, liveinternet.ru, cnzz.com, allegro.pl
$graph = OpenGraph::fetch('http://' . $_GET['domain']);
var_dump($graph->keys());
var_dump($graph->schema);

foreach ($graph as $key => $value) {
    echo "$key => $value";
}
?>
mamadoo commented 8 years ago

I create a pull request and fix this issue: OpenGraph now support UTF-8 Encoding

you can using this for support UTF-8 Encoding. Best Regards