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条)

报告相同问题?

悬赏问题

  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
  • ¥50 我撰写的python爬虫爬不了 要爬的网址有反爬机制
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥120 计算机网络的新校区组网设计
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录