urlencode issue, not translating to Twitter (or anywhere) (2 posts)

  1. chazbeaner
    Posted 7 years ago #

    I'm using a simple TweetThis link with the_permalink and the_title and encoding both, but the output is still getting messed up.

    Here's the code:

    <a href="http://www.twitter.com/home?status=Reading:%20<?php urlencode(the_title()); ?>%20-%20<?php the_permalink(); ?>">TweetThis</a>

    Here's the output:


    What am I missing?

  2. saintlukas
    Posted 7 years ago #

    Did you have any luck with this?
    If I don't urlencode, but just sub out spaces with +

    $twitterMessage = str_replace(" ", '+', $twitterMessage);

    that fixes my spaces, but extra characters like ' or : still come up garbled in FF. OK in Safari, oddly enough.

Topic Closed

This topic has been closed to new replies.

About this Topic