Page 1 of 1

Output ical .ics file, encoding/escaping?

Posted: Thu Feb 18, 2010 4:25 pm
by batfastad
Hi everyone

We output a variety of different formats of data from our intranet database using PHP.
But I was wondering what the best way to output iCal/ics files was.

Do I need to escape and special characters for outputting an ics file?
Is there any special encoding I should use for text/data in the various fields of ics files?

At the moment this is the header I use to output a .ics file:

Code: Select all

header('Content-type: text/calendar; Content-encoding: utf-8');
Then I just echo the data straight out in utf8 from my database. No escaping or encoding or anything.

Should I be escaping or encoding the data before I echo it out into an .ics file?
Any other comments/suggestions with this approach?

Cheers, B