Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

Today I was surprised to see that a guy has hacked Twitter's 140-character limit. The message consists of 930 characters. How could this be possible?

The direct link to this tweet is here. For convenience, I'm copying the screenshot of full tweet below:

enter image description here

share|improve this question
1  
It seems to be a cool trick, but its not a solution for the limit of 140 chars. Actually its BETTER. Because people will state clearly what they need to tell, instead of writing all the rubbish. :) –  user14867 Nov 15 '11 at 17:21
1  
So guys, it might be useful information, in the center of the message there is frase in Russian: Твиттим и не ограничиваемся людиии!!!!!! 140 не предел! Which in English is: Keep twitting without limits, people!!!!! 140 is not a limit! I guess some Russian "hakers"? :-) –  MinimeDJ Nov 16 '11 at 18:33
    
It seems that Twitter has fixed that bug. Check out the direct link to the tweet. –  Mehper C. Palavuzlar Nov 18 '11 at 21:14
    
The short answer: the tweet has less than 140 characters; it's just an encoding issue that's causing your browser to display it as more characters. –  ShreevatsaR Dec 7 '11 at 4:13
    
A comment below states issue has been fixed by twitter. Today I came across another tweet which is quite similar - twitter.com/#!/luchetti/status/177524100930084864 –  Chethan S. Mar 15 '12 at 17:57

2 Answers 2

up vote 39 down vote accepted

The message contains Unicode surrogate code points that are improperly encoded as UTF-8. This kind of improper encoding is also called CESU-8. It appears that some Twitter interfaces will accept the CESU-8 encoded surrogate code points as characters (for the purpose of the 140 character limit), but for display purposes it expects valid UTF-8 and these are not valid UTF-8 sequences. So it instead displays the 3 bytes of each of these sequences as 3 C-style octal escape sequences of 4 characters each, and each surrogate code point ends up being displayed using 12 characters.

For example \355\240\265\355\263\220 when decoded as C-escaped UTF-8, without rejecting surrogates as would normally be done when decoding UTF-8, decodes to the surrogate pair U+D835 U+DCD0. Treating this surrogate pair as UTF-16, as would be done when decoding CESU-8, produces the Unicode character U+1D4D0 MATHEMATICAL BOLD SCRIPT CAPITAL A (𝓐).

If the C-style octal escaping is decoded and then the result is interpreted as CESU-8, it comes out to:

𝓐𝓛𝓜𝓐𝓣𝓨 𝓐𝓛𝓜𝓐𝓣𝓨 𝓐𝓛𝓜𝓐𝓣𝓨 Твиттим и не ограничиваемся людиии!!!!!! 140 не предел!=)))) 𝓐𝓛𝓜𝓐𝓣𝓨 𝓐𝓛𝓜𝓐𝓣𝓨 𝓐𝓛𝓜𝓐𝓣𝓨

Here it is as an image, for those without a full set of Unicode fonts installed:

𝓐𝓛𝓜𝓐𝓣𝓨 𝓐𝓛𝓜𝓐𝓣𝓨 𝓐𝓛𝓜𝓐𝓣𝓨 Твиттим и не ограничиваемся людиии!!!!!! 140 не предел!=)))) 𝓐𝓛𝓜𝓐𝓣𝓨 𝓐𝓛𝓜𝓐𝓣𝓨 𝓐𝓛𝓜𝓐𝓣𝓨

share|improve this answer
1  
actually 101 characters - good job @mark4o –  Jörg Nov 17 '11 at 9:07
3  
It seems that Twitter has fixed that bug. Now the message appears just as the image you posted in your answer. –  Mehper C. Palavuzlar Nov 18 '11 at 21:13
    
I still see the square boxes, @MehperC.Palavuzlar. Is it possible that I don't have ANY fonts installed with a full set of Unicode chars? –  Gaia Oct 25 '13 at 19:27

Each group of characters beginning with a backslash and followed by three numbers is an "Escape Sequence". Each of them represents a single character. These are usually used for characters that don't exist on your keyboard such as non-English-language characters and symbols.

My guess is that when counting the characters, Twitter is counting each of these groups as a single character but when displaying them to the browser it is printing them as four.

Update:

Some of the escape sequences available are "control characters". These tell the computer to do something such as playing an alert sound or moving the cursor left or right or up or down or deleting the character to the left of the cursor. Although none of them are the last one I mentioned (deleting the previous character), he might have used that character to confuse Twitter as well.

Interestingly, when turned back into normal characters, it is quite repetative and looks something like this:

í µ í ³ í µ í ³ › í µ í ³ œ í µ í ³ í µ í ³ £ í µ í ³ ¨ í µ í ³ í µ í ³ › í µ í ³ œ í µ í ³ í µ í ³ £ í µ í ³ ¨ 

Update 2:

The explanation he gave was "Пишите в DM, всегда на связи )" which Google Translate tells me is "Write to the DM, always on connection)". I'm not sure exactly what that means or how it helps.

share|improve this answer
1  
I thought of that as well (it's the most reasonable explanation that comes to my mind), but the problem is that there are way more than 140 groups of four (140*4 = 560, which is less than the 930 count that Mepher stated). –  Alex Nov 15 '11 at 15:10
    
@Alex: That's right. I tried copying and pasting the whole message into a new tweet box, but Twitter says it's more than 140 chars. I also tried in TweetDeck but again no go. –  Mehper C. Palavuzlar Nov 15 '11 at 15:16
    
Well spotted. I've updated my answer but I can't see any evidence that the update is what actually happened. –  Ladadadada Nov 15 '11 at 15:53
2  
@Mehper you couldn't just copy it to a tweet box, because then twitter would interpret it as separate characters ('\', '3', '5', '5') etc. You would have to create a script which sends the "symbols" as bytes, not escape characters. –  Tor Valamo Nov 15 '11 at 18:46
    
"Пишите в DM, всегда на связи )" means he invites you to send him a private message, he'll respond to it quickly. My translation would be: "Send a DM, I'm always there". –  Malcolm Dec 8 '11 at 20:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.