在Facebook墙上张贴希伯来语+英文文本,单词混在一起 [英] Posting hebrew + english text on facebook wall, words get mixed up
本文介绍了在Facebook墙上张贴希伯来语+英文文本,单词混在一起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用我的Java代码在FB墙上张贴内容:
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()
)
);
该消息应为: Yoav postedמתכון
,但是,它的发送方式如下:מתכוןYoav posted
.מתכון
是食谱名称.食谱名称可以是英文或希伯来语(UTF-8).
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?
推荐答案
在发送到fb之前,您应该先json_encode,然后再进行json_decode,这可以解决问题:
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);
这个想法来自这里: https://stackoverflow.com/a/3806967/1200166
这篇关于在Facebook墙上张贴希伯来语+英文文本,单词混在一起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文