Encoding newlines in iCal files

OK, looks like I’m answering my own question.

The correct way to do it is to use “\n” for line breaks. Outlook did not recognize this because I had “ENCODING=quoted-printable” on the description. Once I removed that, Outlook displayed the new lines correctly.

Also, to get the file to open correctly in Apple iCal, you need to use “VERSION:2.0” for the file version. If you use “VERSION:1.0”, it will tell you it can’t read the file (even though it conforms to the 1.0 spec).

NOTE: As others have mentioned, the file actually has to contain the literal string \n. Since most languages treat that as an escape sequence meaning a newline character, you probably need to use the string \\n in your code.

Leave a Comment