Posted tweet's content that include emoji contains unnecessary characters


#1

I want to post a tweet that include emoji(:arrow_right:) by RESTAPI.

so I post a tweet as below by using PHP’s library .

$tweetContent = "@xxxxxx
【 TwitterTrend 】
➡️ t.co/xxxxxx
t.co/yyyyyy
";

$replyObject = [
            "status" => $tweetContent,
            "in_reply_to_status_id" => "xxxxxxxxxxxxxxxxxxxx",
            "attachment_url" => "https://twitter.com/" . $tweetInfo->user->screen_name . "/status/" . $tweetInfo->id
        ];

$this->connection->post("statuses/update", $replyObject);

But this created tweet by RESTAPI is as below.

@xxxxxx
【 TwitterTrend 】
...
...
➡️ htest.com 
...
...
htwitter.com

What I wondered was that there is h between :arrow_right: and test.com. also htwitter.com 's h

I want eliminate these h. so Please tell me the way.


#2

I’m not familiar with PHP so I can’t directly help you on this.

Have you tried posting the Tweet using any other methods?
For example, using curl or twurl?

ex/
curl --request POST
–url ‘https://api.twitter.com/1.1/statuses/update.json?status=This%20is%20a%20test
–header ‘authorization: OAuth oauth_consumer_key=“XXXXXX”, oauth_nonce=“YYYYYY”, oauth_signature=“ZZZZZZ”, oauth_signature_method=“HMAC-SHA1”, oauth_timestamp=“WWWW”, oauth_token=“VVVVVV”, oauth_version=“1.0”’