twitter-text
twitter-text copied to clipboard
Wrong character count
When using the JS version and passing the following message through getTweetLength, it returns exactly 280 characters but Twitter considers it having 282.
"Para obter o bilhete único comum você faz a solicitação pelo site da SPTrans e retira no posto que escolher, personalizando com sua foto e nome (inclusive com o nome social 😉). Não esqueça de comprar créditos pelo aplicativo da RPC. 😍 #RPCInforma #BilheteUnico #SãoPaulo #SPTran"
Edit: Version 2.0.5 - https://github.com/twitter/twitter-text/blob/master/js/pkg/twitter-text-2.0.5.js
Hi @freeman2kbr! Can you explain what you mean by this?
it returns exactly 280 characters but Twitter considers it having 282.
Twitter uses whatever is returned by twitter-text as the source of truth. And I am able to create a tweet with the text you quoted.
Strange... I attached a image from twitter using this same text and it says -2 characters remaining.
I am seeing this same behavior on different text using library [email protected].
I'm having the same issue with a different text using [email protected] in ruby. The library tells me 258 chars, and twitter says I have 289 chars. I thought the issue was some links which did not have http:// before, but adding it just bumps the count to 277, still different from twitter interface.
This is an equivalent text:
Le mardi 21/12, 🐘[email protected] sera à #riodejan en #cancan (au côté de nos ami⋅e⋅s de utopie.ch de chisslinux.org et de la uth.ch ) pour une conférence « Ruelles alternatives aux multinationales du atlanique ? »
http://www.some-url.com/
> Twitter::TwitterText::Validation.parse_tweet(text)
=> {:weighted_length=>258, :valid=>true, :permillage=>921, :valid_range_start=>0, :valid_range_end=>246, :display_range_start=>0, :display_range_end=>246}
Hi guys, is this problem solved in any version? I have the same issue with version 3.0.1 on 2020 Jan
1️⃣ character is counted as 1 character with twitter-text but counted as 2 characters on Twitter UI Tested on twitter-text 3.0.1