The problem is that get_the_title()
will pass the title through a filter that texturizes the quotes. So a regular ” becomes a curly quote (“) and urlencode()
will break it.
So instead, write your own title function and use that:
function my_get_the_title() {
global $post;
return $post->post_title;
}
This should bypass any unwanted filters and let you work with regular quotes.