title: Twitter share - redirects urlencode param %2C to %252C
body: <p>I'm using the twitter custom share button 'Build your own tweet button' (https://dev.twitter.com/docs/tweet-button).
  The documentation says that I have to use the query parameters to pass on params.</p>
  
  <p><strong>PROBLEM:</strong> Twitter is encoding the text param wrong when I pass it a URL encoded string. A comma (,) is displayed as %252C in the tweet message. Other chars are also wrong encoded.</p>
  
  <p>I use PHP url encode (http://php.net/manual/en/function.urlencode.php) to prepare the string for the call.</p>
  
  <pre><code>$text = urlencode("I just backed ". $project-&gt;getTitle().", an amazing new mobile app, on appbackr, where anyone can back mobile apps");
  </code></pre>
  
  <p>Then I build the twitter link:</p>
  
  <pre><code>'http://www.twitter.com/share?url='.urlencode($projectUrl).'&amp;via='.$via.'&amp;text='.$text.'&amp;related='.$user-&gt;getTwitterProfileName()
  </code></pre>
  
  <p>The final twitter url call is:</p>
  
  <pre><code>http://www.twitter.com/share?url=http%3A%2F%2Flocalhost%2Fapp%2Fbig-top-ballet&amp;via=appbackr&amp;text=I+just+backed+Big+Top+Ballet%2C+an+amazing+new+mobile+app%2C+on+appbackr%2C+where+anyone+can+back+mobile+apps&amp;related=philippberner
  </code></pre>
  
  <p>As soon as the page opens in the browser (Chrome and Firefox) twitter redirects the URL to:</p>
  
  <pre><code>https://twitter.com/intent/tweet?related=philippberner&amp;text=I+just+backed+Big+Top+Ballet%252C+an+amazing+new+mobile+app%252C+on+appbackr%252C+where+anyone+can+back+mobile+apps&amp;url=http%253A%252F%252Flocalhost%252Fapp%252Fbig-top-ballet&amp;via=appbackr
  </code></pre>
  
  <p>This displays the following message in the tweet box:</p>
  
  <blockquote>
    <p>I just backed Big Top Ballet%2C an amazing new mobile app%2C on appbackr%2C where anyone can back mobile apps via @appbackr</p>
  </blockquote>
  
  <p>It converts <em>Top+Ballet%2C+an+amazing</em> to <em>Top+Ballet%252C+an+amazing</em>. The comma is displayed properly when I manually change %252C to %2C in the twitter URL.</p>