Single Tweet using ‘Punycode’ url causes Twitter App to crash on iPhone and iPad
If you received the below Tweet from one of your friends just one day back, your Twitter App may have crashed if you were using a iPhone or iPad. Discovered by Twitter users, this tweet contains a bug which causes the Twitter iOS to crash when a specific URL is tweeted on the network.
I just saved productive time to iPhone users being distracted by Twitter.
(tweet makes Twitter for iOS crash)http://t.co/mDQI4aeAbC
— Frederic Jacobs (@FredericJacobs) November 16, 2014
The strange thing about this bug is that if the tweet containing this type of URL even appears on your timeline, your Twitter App will crash even without clicking on the URL. This bug was discovered by a Twitter user going by the handle of @CPVideoMaker whose real name is Alfonso Dingo Torres. This was the message that Alfonso was sending to his followers and in the process crashing their Twitter App.
— Dingo ???????? (@DingoTech) November 16, 2014
The crash of the Twitter App is result of a bug which is related to the tweet containing a URL encoded with a ‘Punycode.’ Punycode is a way to represent International Domain Names (IDNs) with the limited character set (‘a’-‘z’, ‘0’-‘9’) supported by the domain name system. For example “münich” would be encoded as “mnich-kva”. An IDN takes the punycode encoding, and adds a ‘xn--‘ in front of it.
In computing, Punycode is an instance of a general encoding syntax (Bootstring) by which a string of Unicode characters is transformed uniquely and reversibly into a smaller, restricted character set. The punycode is used because of several advantages which are given below :
- Language independent
- Superior in compression
- Compact in code size
- Round-trip safe
- Superior for encoding Chinese/Japanese/Korean characters. (over other ACE schemes evaluated at that time)
Response from Twitter
After causing many a Twitter Apps to collapse and raising a hailstorm over social media networking websites, Alfonos contacted Twitter about the bug. He tweeted the reply he got from Twitter which is given below :
— Dingo ???????? (@DingoTech) November 17, 2014
Even as thousands Twitterati used the social network via alternative apps to express their frustration that the official Twitter app for iOS seemingly wouldn’t open after encountering the Punycode tweet, Twitter engineers quietly fixed the bug. Strangely the bug doesn’t appear to affect third party apps of Twitter or Twitter’s apps on other platforms like Android or Windows Phone.
As of now your Twitter App wont crash if you have received a tweet with a Punycode embedded URL.