3 ms·
UTF-8 is 1-4 bytes per codepoint dude, not 1-2. 280 * 4 = 1120, not 560.
by KingLancelot 4y ago
UTF-8 is 1-4 bytes per codepoint dude, not 1-2.
280 * 4 = 1120, not 560.
- Dylan16807 4y agoTwitter doesn't allow 280 of any codepoint. The more complicated ones count double against your limit.
- KingLancelot 4y agoAh, so Twitter’s Unicode implementation is fucked.
- Dylan16807 4y agoNothing is wrong with it. If it counted UTF-16 code units that would be dumb. It doesn't. The cutoff was deliberately set to keep the 140 character limit for CJK but increase it to 280 for the rest. And they did that based on observational data. https://cdn.cms-twdigitalassets.com/content/dam/blog-twitter/official/en_us/products/2017/giving-you-more-characters-to-express-yourself/more-chars-1.png https://cdn.cms-twdigitalassets.com/content/dam/blog-twitter... https://blog.twitter.com/en_us/topics/product/2017/Giving-you-more-characters-to-express-yourself https://blog.twitter.com/en_us/topics/product/2017/Giving-yo...