Why does Twitter say my status update is over 140 characters when I only posted 130?

I could tweet hundreds of times on iOS, but I came across one tweet that I just can't tweet. This tweet is only 130 characters long, but Twitter responds by claiming it is over 140 characters long. So Twitter won't post it.

Relevant code:

- (void)tweet:(NSString *)message
{
    SLRequest* request = [SLRequest
        requestForServiceType:SLServiceTypeTwitter
        requestMethod:SLRequestMethodPOST
        URL:[NSURL URLWithString:[NSString stringWithFormat:
            @"%@statuses/update.json",
            API_BASE_URL
        ]]
        parameters:@{
            @"status": message
        }
    ];
    request.account = self.context.account;
    [request performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *eror) {
        if (responseData != nil) {
            NSLog(@"%@", [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding]);
        }
     ];
}

      

Console printouts:

(lldb) po message
@juandoming Dallas teachers improved student performance by 20% w/mobile video messaging. Would this be useful to you? Ccccccc.com

(lldb) p message.length
(unsigned int) $1 = 130
2014-09-11 12:25:01.326 app[1685:6b13] {"errors":[{"code":186,"message":"Status is over 140 characters."}]}
(lldb) 

      

The actual URL is not Ccccccc.com but has the same number of characters.

+3


source to share


1 answer


Your url is probably 20 characters long.

https://twittercommunity.com/t/getting-the-text-of-your-tweet-is-too-long-error-with-140-character-tweets/13307



"For all intents and purposes, all URLs and most things that look like URLs essentially have to be considered 20 characters long when composing a tweet. Clients and sites that display t.co links make this process transparent - see the submission the original bit.ly link is in the UI, but underneath is still wrapped in t.co. "

+4


source







All Articles