Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Recent Twitter char counting changes 😭 #8
evidently, along with the recent switch to 280 chars, twitter also changed the way they count chars. (IRC discussion.) it's no longer simply unicode code points, it's some weighted thing i don't understand yet. one big effect is that emoji seem to now count for two chars, not one.
this made e.g. @tantek's recent bridgy publish attempt fail. we tried to publish this content:
which twitter 403ed it with "Tweet needs to be a bit shorter."
if you count chars normally, it's 319 total, - 17 + 23 for
however, if you paste it into the twitter UI, that says it's 3 chars over. deleting the camera and ellipsis emoji each drop it by 2. i haven't found the last extra char yet.
ok, after reading the docs, i understand the new way. some chars (code points) now count for two instead of one, and they have a data driven config that determines which are which. it'll take a little work to implement, but not a ton. seems doable.