I am trying to create a facebook application (just learning) which will show unicode character. So I write this code:
<?php
$json = file_get_contents('https://graph.facebook.com/Answersge');
$data = json_decode($json, true);
echo $data['company_overview'];
?>
This code was suppose to render like this:
იპოვეთ პასუხი ნებისმიერ კითხვაზე! Screenshot: https://i.stack.imgur.com/JJfKU.png
And it work as expected in firefox. But in Google Chrome and Internet Explorer is shows some thing like this:
იპáƒáƒ•ეთ პáƒáƒ¡áƒ£áƒ®áƒ˜ ნებისმიერკითხვáƒáƒ–ე!
which is of course wrong. Is there anyway I can fix this?
Add the following tag before the
titleelement:You’re getting the data as utf-8 encoded and need to declare it as such. Without any declaration, browsers make a guess.