twitter / twitter-text

Twitter Text Libraries. This code is used at Twitter to tokenize and parse text to meet the expectations for what can be used on the platform.
https://developer.twitter.com/en/docs/counting-characters
Apache License 2.0
3.07k stars 520 forks source link

Different behaviour of twitter-text & twitter-api #257

Closed ignatda closed 6 years ago

ignatda commented 6 years ago

Environment:

com.twitter.twittertext twitter-text 2.0.10

Text Nous serons à partir de demain au SEO Camp'us Paris 2018 🎯 Également, @NathalieSEMrush vous réserve une superbe présentation vendredi à 16h45 en salle Netlinking.fr People Also Ask : une nouvelle opportunité pour être plus présent sur la SERP @seocamp #PAA #SEO #Google

Emoji unicode representation is "\uD83C\uDFAF", then goes "\n" After "Netlinking.fr" goes " \n" (with whitespace)

Error If You will use this text for making post in API, you will receive 403 error like code=186, message="Tweet needs to be a bit shorter" If You will use this text for making post by Twitter UI, you will receive "-1" as valid-text-counter value. If You will use this text for validating text by twitter-text, twitter-text will say that's isValid=true!

Fix that, please! Thank you!

ignatda commented 6 years ago

It was my mistake, sorry.