From 9522c817654c435f1929f4a37961780346406cf7 Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Mon, 20 Sep 2021 10:08:15 +0200 Subject: ics: fix issues with EOLs End of lines in iCalendar files should be CRLF, but some (most?) lines generated by µCS were LF. This changes that. Signed-off-by: Alban Gruin --- src/ics.ml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/ics.ml b/src/ics.ml index d6d165a..732cbd5 100644 --- a/src/ics.ml +++ b/src/ics.ml @@ -56,9 +56,9 @@ module Event = struct "SUMMARY:" ^ event.summary; "COMMENT:" ^ String.concat ", " event.groups; "LOCATION:" ^ event.location; - "END:VEVENT\n"] + "END:VEVENT\r\n"] |> List.map ics_split_line - |> String.concat "\n" + |> String.concat "\r\n" let has_groups groups event = List.fold_left (fun found group -> @@ -76,11 +76,11 @@ let filter_groups groups = let gen_vtimezone tz = if tz <> "" then - ["BEGIN:VTIMEZONE"; - "TZID:" ^ tz; - "END:VTIMEZONE\n"] - |> List.map ics_split_line - |> String.concat "\n" + ["BEGIN:VTIMEZONE"; + "TZID:" ^ tz; + "END:VTIMEZONE\r\n"] + |> List.map ics_split_line + |> String.concat "\r\n" else "" @@ -97,9 +97,9 @@ let to_string tz events = | [] -> str | event :: l -> gen_events (id + 1) (str ^ Event.to_string date event id) l in - "BEGIN:VCALENDAR\n\ - VERSION:2.0\n\ - PRODID:-//ucs//\n" + "BEGIN:VCALENDAR\r\n\ + VERSION:2.0\r\n\ + PRODID:-//ucs//\r\n" ^ vtimezone ^ gen_events 0 "" events - ^ "END:VCALENDAR\n" + ^ "END:VCALENDAR\r\n" -- cgit v1.2.1