Monday, March 26, 2012

Hey, Twitter! Where's my hyphen gone?

So, I noticed this morning that the Twitter web client eats the hyphen in my name. Here's a picture of my Twitter settings:

There I've got a hyphen.

Here's what happens when I load my Twitter timeline; the hyphen is present and then about 1 second later it disappears:

Oddly this only happens in Safari and not in Google Chrome or Mozilla Firefox. The same thing happens with another hyphenated Twitter user. Here's how Duncan Graham-Rowe appears in a Google search:

And then I click through and his hyphen is lost:

A little bit of testing showed that it's not just in the name. The - gets eaten in the Bio field as well.

When the Twitter client first starts it requests at HTML page (with the URL #!) and it contains my name with its hyphen:
But something changes it (and, as it turns out, all the other names that appear in my timeline) so the hyphen has been eaten:

A further quick test showed that the following characters are all accepted as part of my name, but magically disappear when displayed (in the manner shown above): - ( ) * , . +.

And here's where the finger points away from Twitter and over to Apple: everything's fine on Version 5.1.2 (7534.52.7), but that list of characters is gone on Version 5.1.4 (7534.54.16), a release that included lots of Javascript optimization.

Hey, Apple. Where's my hyphen?

PS I'd be tempted to debug this but (a) figuring out which bit of Javascript changed a DOM element isn't trivial and (b) Twitter's templating system written in Javascript isn't exactly the most debuggable or followable piece of code I've seen.

1 comment:

tkadlubo said...

One simple (and classy) work-around is to use U+2010, the real hyphen, rather than ASCII 0x2d, which is a hybrid of hyphen and minus sign.