0

I am posting on my FB wall using my java code:

FacebookType publishMessageResponse = facebookClient.publish(
    connection,
    FacebookType.class,
    Parameter.with(
        "message",
        fbMessageData.getRecipeOwnerName() +
            " posted " +
            fbMessageData.getRecipeName()
    )
);

The message should be: Yoav posted מתכון, however, it gets posted like this: מתכון Yoav posted. מתכון is the recipe name. The recipe name can be in English or Hebrew (UTF-8).

Any ideas on how to keep the order?

Matthias
  • 7,432
  • 6
  • 55
  • 88
user1136875
  • 613
  • 1
  • 9
  • 22
  • As far as I know, this is how a web browser usually displays mixed LTR and RTL text. Have you changed Facebook's display language to Hebrew to see if it's displayed correctly in Hebrew? – Michael Hampton Jul 12 '12 at 15:54
  • No,since it needs to be shown the same from either english or hebrew fb view – user1136875 Jul 12 '12 at 16:16

2 Answers2

0

Have you tried using one of the Unicode BiDi_Control characters? Putting it in front of or around your recipe name …

http://en.wikipedia.org/wiki/Bi-directional_text

CBroe
  • 91,630
  • 14
  • 92
  • 150
0

You should json_encode and then json_decode before sending to fb, it does the trick:

$album_details = array(
  'message'=> 'Live photos from our app',                      
  'name'=> $title, // This can be any non-english characters that can be in unicode
  'access_token'=>$pageAccessToken
);

$jsonStr = json_encode($album_details);
$decoded_album_settings = json_decode($jsonStr, true);

$create_album = $this->facebook->api('/'.$this->facebookPageId.'/albums', 'post', $decoded_album_settings);

The idea was taken from here: https://stackoverflow.com/a/3806967/1200166

Community
  • 1
  • 1
rantebi
  • 61
  • 1
  • 5