Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for 280 characters #143

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cfuhrman
Copy link

As Twitter has recently introduced support for 280 characters[1], bump up
maximum character limit in twittering mode. While here, make the maximum
character limit a defvar for ease of maintenance.

Closes #142

Footnotes:
[1] https://blog.twitter.com/official/en_us/topics/product/2017/Giving-you-more-characters-to-express-yourself.html

As Twitter has recently introduced support for 280 characters[1], bump up
maximum character limit in twittering mode.  While here, make the maximum
character limit a defvar for ease of maintenance.

Closes hayamiz#142

Footnotes:
[1]  https://blog.twitter.com/official/en_us/topics/product/2017/Giving-you-more-characters-to-express-yourself.html
@humitos
Copy link

humitos commented Nov 16, 2017

Nice! Looks good to me. I would like it to be merged :)

@cyborgmarina
Copy link

Thanks for that! Looks good to me as well.

@ahungry
Copy link

ahungry commented Dec 13, 2017

👍

@iRi-E
Copy link

iRi-E commented Dec 14, 2017

This is incomplete solution.
Twitter now uses "weighted length" instead of max number of characters:
https://developer.twitter.com/en/docs/developer-utilities/twitter-text

A CJK character such as "あ" consumes 2 counts, so CJK tweets are still limited to 140 chars.
For example, "abcdefgh" and "あいうえ" and "abcdうえ" have same length 8.

@ahungry
Copy link

ahungry commented Dec 15, 2017

So, would 280 bytes be more correct? (I assume that symbol is a 2 byte unicode?)

@iRi-E
Copy link

iRi-E commented Dec 15, 2017

No, that's not. The "weighted length" is besed on the amount of information in one character, not related to the size of unicode's byte sequence. FYI, most of Japanese characters are 3 byte sequences.

@cvmat
Copy link
Collaborator

cvmat commented Dec 31, 2017

Thanks @iRi-E for the URL of the document.
I have committed support for posting a tweet longer than 140 characters as 8e9e812 .

As all of you know, the implementation is not so simple as replacing 140 with 280.
(You can see it at 8e9e812 .)
When I had read the entry https://blog.twitter.com/official/en_us/topics/product/2017/tweetingmadeeasier.html , I had failed to find the strict definition of

Japanese, Korean, and Chinese will continue to have 140 characters.

Which character should be counted by the same way as Japanese? In fact, some other characters such as the Ethiopic ones and Cherokee ones also counted as similarly to Japanese. To implement this, I need the strict definition.
Now, the definition still seems not to be provided as a public official REST API. I have taken a forcible method that directly retrieves the definition from https://github.com/twitter/twitter-text/ , which is committed at 2017-12-15. However, I think such a method may not be officially recommended.

@afukumoto
Copy link

In addition to 8e9e812, I think twittering-edit-length-check needs modification to update twittering-warning-overlay properly in accordance with weighted character length.

@cvmat
Copy link
Collaborator

cvmat commented Jan 7, 2018

Thank you, @afukumoto .
As you pointed out, some patches are required for fixing the warning overlay on the edit buffer.
I have committed them as c27d9b5 .
Please try it.

@afukumoto
Copy link

It works well, thank you!

@Wilfred
Copy link

Wilfred commented Jun 30, 2018

#142 is now closed and fixed, so I think this PR can be closed too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants