Facebook'ta sorun İbranice düzeltmek

0 Cevap php

i have code that know how to connect to user facebook account,and take his name. this function does works well, the problem is , when i try to get hebrew name, than i get gibrish.

charset = windows-1255 - ben de UTF-8 denedim, ve hala ben gibrish var.

for gibrish example: ׳׳™׳˜׳ ׳§׳•׳•׳ ׳–

kodu:

require 'src/facebook.php';

$facebook = new Facebook(array(
  'appId'  => '1294881225',
  'secret' => '6d28eq8fe1',
  'cookie' => true,
));

$session = $facebook->getSession();

$me = null;
// Session based API call.
if ($session) {
  try {
    $uid = $facebook->getUser();
    $me = $facebook->api('/me');
  } catch (FacebookApiException $e) {
    error_log($e);
  }
}

// login or logout url will be needed depending on current user state.
if ($me) {
  $logoutUrl = $facebook->getLogoutUrl();
} else {
  $loginUrl = $facebook->getLoginUrl();
}
<script>
  window.fbAsyncInit = function() {
    FB.init({
      appId   : '<?php echo $facebook->getAppId(); ?>',
      session : <?php echo json_encode($session); ?>, // don't refetch the session when PHP already has it
      status  : true, // check login status
      cookie  : true, // enable cookies to allow the server to access the session
      xfbml   : true // parse XFBML
    });

    // whenever the user logs in, we refresh the page
    FB.Event.subscribe('auth.login', function() {
      window.location.reload();
    });
  };

  (function() {
    var e = document.createElement('script');
    e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
    e.async = true;
    document.getElementById('fb-root').appendChild(e);
  }());
</script>

<?php echo "<font color=white>name: "  . $me['name']  . "</font>" ; ?>

, teşekkürler

0 Cevap