Sep 182009

After using WebCalendar for quite I while, I finally got to the bottom of the problem, why it wasn’t working as a remote calendar in Mozilla Sunbird or in the Thunderbird extension Lightning.

Following the official description how to subscribe to a remote calendar did add the calendar successfully, but showed a yellow warning sign with the caption

The calendar foobar is momentarily not available

This message actually points to a connection problem, network wise or maybe concerning the webserver. Even though I had done everything according to the description, it didn’t help.
For a long time, this was the status quo – surprisingly the calendar worked from time to time, without any explanation.

However, trying to open an exported .ics file with Lightning/Sunbird pointed me into another direction, because it still claimed to be momentarily not available, even though no network or other connection was involved.
Honestly, I should have tried it before, but this was the first time I opened Thunderbird’s Error Console to see a more descriptive warning message:

Warning: There has been an error reading data for calendar: foobar. Error code: CAL_UTF8_DECODING_FAILED. Description: An error occurred while decoding an iCalendar (ics) file as UTF-8. Check that the file, including symbols and accented letters, is encoded using the UTF-8 character encoding.

and if any Germans have this problem:

Warnung: Fehler beim Lesen von Daten für Kalender: foobar. Fehlercode: CAL_UTF8_DECODING_FAILED. Beschreibung: Ein Fehler ist beim Dekodieren einer iCalendar(ics)-Datei als UTF-8 aufgetreten. Überprüfen Sie, dass die Datei, inklusive Symbolen und akzentierten Buchstaben, mit dem UTF-8-Zeichensatz kodiert ist.

So, obviously it was an encoding problem. I tried to save the exported ICS file in several encodings and could open it with Sunbird/Lightning if it was properly encoded in UTF-8.
The message in Thunderbird’s error console finally made it easy to google the problem (as opposed to the warning caption telling me that the calendar was momentarily not available). People seemed to have this very problem when they used special characters in their WebCalendar. And in fact, as I removed the special characters I was using in some event descriptions, loading the calendar in Lightning worked just fine.

One solution for the problem is not to use any special characters, the other one is just a workaround until they fix this issue (which is still commented as a TODO in the code btw 😉 ): This WebCalendar SourceForge Bugtracker comment tried to comment out a few lines in the WebCalendar source code. The final code of my “webcalendar-dir”/includes/classes/WebCalendar.class now looks like this (around line 870 in v1.2.0):

This workaround works fine for me at the moment. Hope it does as well for anybody having this problem :)

Please do comment your experiences.

  3 Responses to “WebCalendar is not working with Lightning or Sunbird”

  1. You saved my day!

  2. Great post, I wish I read it 4 hours ago ….

  3. Thank you!! This helped me a lot!

 Leave a Reply




You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">