All-in-One Event Calendar
[resolved] Exported Calendar shows htmlentities (7 posts)

  1. shrmn
    Posted 4 years ago #

    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 ) );


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


  2. ullemehner
    Posted 4 years ago #

    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!


  3. shrmn
    Posted 4 years ago #

    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!

  4. Yani Iliev
    Plugin Contributor

    Posted 4 years ago #

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

  5. shrmn
    Posted 4 years ago #

    Thank you Yani!

  6. shrmn
    Posted 4 years ago #

    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

  7. ullemehner
    Posted 4 years ago #

    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 );


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


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • All-in-One Event Calendar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic