dpqy77560 2013-02-19 14:53
浏览 28
已采纳

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

I'm using the Buffer API with PHP and I can't figure out how to post the € symbol. I've tried without encoding, url encoded and utf8 encoded and neither of these has worked.

If I try to post: "I have 5€ in my pocket lol" All I get is: "I have 5 in my pocket lol"

How can I post this kind of symbols? Thank you!

here's the code:

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条回答 默认 最新

  • dongyiba8082 2013-02-19 15:24
    关注

    It works for me with \xE2\x82\xAc

    Hope it works for you!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?