无法使用Buffer API发布“€”符号

时间:2013-02-19 14:53:42

标签: php encoding

我正在使用带有PHP的Buffer API,我无法弄清楚如何发布€符号。我试过没有编码,url编码和utf8编码,这些都没有用。

如果我尝试发帖:“我的口袋里有5欧元哈哈” 我得到的只是:“我的口袋里有5个lol”

我如何发布这种符号?谢谢!

这是代码:

require_once 'class.bufferapp.php';
$buffer = new BufferPHP('1/XXXXXXXXXXXXXXXXXXXXXXX');
$data = array('profile_ids' => array());
$data['profile_ids'][] = 'XXXXXXXXXXXXXXXXXXX';


$data['text'] = "I have 5€ in my pocket lol";
$ret = $buffer->post('updates/create', $data);
var_dump($ret);

/* Response:

object(stdClass)#2 (5) { ["updates"]=> array(1) { [0]=> object(stdClass)#3 (16) { ["_id"]=> string(24) "XXXXXXXXXXXXXXXXXXXX" ["client_id"]=> string(24) "XXXXXXXXXXXXXXXXXXX" ["created_at"]=> int(1361285095) ["day"]=> string(5) "Today" ["due_at"]=> int(1361289540) ["due_time"]=> string(7) "4:59 pm" ["id"]=> string(24) "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" ["profile_id"]=> string(24) "XXXXXXXXXXXXXXXX" ["profile_service"]=> string(7) "twitter" ["status"]=> string(6) "buffer" ["text"]=> string(25) "I have 5 in my pocket lol" ["text_formatted"]=> string(25) "I have 5 in my pocket lol" ["type"]=> string(4) "text" ["updated_at"]=> int(1361285095) ["user_id"]=> string(24) "XXXXXXXXXXXXXXXXXXX" ["via"]=> string(3) "api" } } ["buffer_percentage"]=> int(20) ["buffer_count"]=> int(2) ["success"]=> bool(true) ["message"]=> string(49) "One more tweet in your Buffer. Keep it topped up!" }

2 个答案:

答案 0 :(得分:0)

用&#8364

替换标志

答案 1 :(得分:-1)

\xE2\x82\xAc

对我有用

希望它适合你!