WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to create Google calendar links from posts, I do it like so:

$base_url = 'http://www.google.com/calendar/event';
        $params = array(
            'action' => 'TEMPLATE',
            'text' => strip_tags(get_the_title()),
            'dates' => $dates,
            'details' => strip_tags( get_the_excerpt() ),
            'location' => $location,
            'sprop' => get_option('blogname'),
            'trp' => 'false',
            'sprop' => 'website:' . home_url()
        $url = add_query_arg( $params, $base_url );
        return esc_html($url);

but IE reads UTF-8 chrachters in URL as percent-encoded (this is a general issue, because the standard "pretty urls" are precent-encoded in IE as well), so instead of


I get


Is there a solution for this problem on WP side? I'm not sure how to tackle this issue, could it be in WP core or is there something I can do for my generated calendar urls. I must note that FX and Chrome encode the characters correctly. Thanks

share|improve this question
Take a look at url_encode() and url_decode(). Both are native php functions that can be found on php.net. – kaiser Feb 23 '12 at 10:32
@kaiser and @David Gard, thank you guys . All I needed to do was urlencode() instead of strip_tags and add urlencode to the location var. – Jukov Feb 23 '12 at 12:35
up vote 0 down vote accepted

Have a look at the PHP function urlencode(), that will hopefully help.

Also, in the latest update of Wordpress (3.3.1) they have fixed it so that permalinks (post slugs) no longer contain special characters. This of course doesn't help with your already existing slugs, but I'm sure there are ways and means of cleaning that field in your database.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.