• Resolved shrmn

    (@shrmn)


    Hi, I subscribed to my WordPress calendar in Google Calendar.

    My events have a dash in them (“J2 – H1 General Paper”) and they show its html special character in Google Calendar instead of a dash (“J2 – H1 General Paper”).

    I found the location to fix this – the issue is that – is UTF-8 encoding.

    In version 1.5 of the plugin, you can edit /all-in-one-event/calendar/app/helper/class-ai1ec-exporter-helper.php to fix this.

    Change line 68:

    $e->setProperty( 'summary', html_entity_decode( apply_filters( 'the_title', $event->post->post_title ), ENT_QUOTES ) );

    to

    $e->setProperty( 'summary', html_entity_decode( apply_filters( 'the_title', $event->post->post_title ), ENT_QUOTES, 'UTF-8' ) );

    http://wordpress.org/extend/plugins/all-in-one-event-calendar/

Viewing 6 replies - 1 through 6 (of 6 total)
  • ullemehner

    (@ullemehner)

    Thank you shrmn for this helpful hint!

    And now I see why it makes the difference, giving html_entity_decode() an explicit character set to decode:

    The default mode for html_entity_decode() is to decode html entities to ISO-8859-1 characters. But only if the decoded character belongs to ISO-8859-1 !
    Otherwise – like the special dash (mdash) you mentioned – it leaves it undecoded 🙁 …

    So this could help solving the problems in those threads:

    Compatibility with French – accentuated letters – Google export

    Special characters and html in ical and googlecal

    If it does, I hope this will make it into next update of Ai1ec!

    Cheers
    Ulle

    Thread Starter shrmn

    (@shrmn)

    Yep you’re spot on!

    I’m using that modified code in my version now and it works great! (:

    Hope the developers can get it fixed in the next release!

    Yani

    (@yaniiliev)

    Fix has been added to the trunk and will be available in the next version

    Thread Starter shrmn

    (@shrmn)

    Thank you Yani!

    Thread Starter shrmn

    (@shrmn)

    Just a heads up, this issue is also present in Descriptions of events, and has been fixed in this post:

    Fix: Description in exported calendar has htmlentities and tags

    I just checked in release candidate (1) for 1.8: This issue is still not fixed, neither in free and premium.

    Hope the simple solution by shrmn will finally make it into final 1.8:

    Line 69, change

    $content = apply_filters( 'the_content', $event->post->post_content );

    to

    $content = html_entity_decode( strip_tags(apply_filters( 'the_content', $event->post->post_content )), ENT_QUOTES, 'UTF-8');

    Cheers,
    Ulle

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: All-in-One Event Calendar] Exported Calendar shows htmlentities’ is closed to new replies.