I just tweeted a link to this question What is the best C++ interview question? and the content had the two + signs (for C++) replaced with spaces. I edited it back to + signs, but I don't see why it should do that?


aha, correct, this was a bug

var url = 'http://twitter.com/share?url=' + encodeURIComponent(link) + 
          '&ref=twitbtn&text=' + encodeURIComponent(message);


var url = 'http://twitter.com/share?url=' + encodeURIComponent(link) + 
          '&ref=twitbtn&text=' + escape(message);

The plus sign (+) just needs to be encoded before it's sent to Twitter.

So the part that's this:


should ideally, if we're wanting to double-plus the face (which itself isn't on the question's URL), be this:


Twitter just interprets the plus signs as a space because that's the shorthand.

So it's and/or depending on if that plus sign will ever be encoded before being sent.

  • I'm not worried about the URL, but the actual content of the tweet. – Kate Gregory Dec 12 '10 at 23:37
  • The URL sent to Twitter (which creates the tweet content) is causing Twitter to interpret the ++ as spacespace @kat – random Dec 12 '10 at 23:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .