Ihor Radchenko writes: > Side note: here, and in other places, we use "\n" as end of line. Yet, > for example > https://icalendar.org/iCalendar-RFC-5545/3-8-2-4-date-time-start.html > prescribes CRLF (\r\n). Also, see > https://orgmode.org/list/87ilgljv6i.fsf@localhost > If you are familiar with iCalendar spec, may you look through the > ox-icalendar code and check other places where we do not conform to the > newline spec? org-icalendar--vtodo is wrapped in org-icalendar-fold-string, so this "\n" gets converted to CRLF later on. However you are right that other parts of the iCalendar export have inconsistent line endings. Currently, VEVENT and VTODO components have the correct CRLF endings, but the other parts of the VCALENDAR do not (such as the preamble). I like your suggestion in the above thread to just wrap the whole export in `org-icalendar-fold-string'. Though I think it's slightly nicer to do it in `org-icalendar--vcalendar' instead of `org-icalendar-template'. So, I've attached a standalone patch to do this. It also fixes an issue with `org-icalendar-fold-string' where the last newline was missing "\r", and adds a unit test. Note that fixing the line endings causes a surprising compatibility issue with org-caldav. I fixed this problem on the org-caldav side, and made a note in ORG-NEWS.