diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/IcsExporter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/IcsExporter.kt index 4b73236e3..67ec30ff9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/IcsExporter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/IcsExporter.kt @@ -25,9 +25,8 @@ class IcsExporter { out.writeLn(BEGIN_CALENDAR) for (event in events) { out.writeLn(BEGIN_EVENT) - - event.title.let { if (it.isNotEmpty()) out.writeLn("$SUMMARY:$it") } - event.description.let { if (it.isNotEmpty()) out.writeLn("$DESCRIPTION$it") } + event.title.replace("\n", "\\n").let { if (it.isNotEmpty()) out.writeLn("$SUMMARY:$it") } + event.description.replace("\n", "\\n").let { if (it.isNotEmpty()) out.writeLn("$DESCRIPTION$it") } event.importId?.let { if (it.isNotEmpty()) out.writeLn("$UID$it") } event.eventType.let { out.writeLn("$CATEGORIES${activity.dbHelper.getEventType(it)?.title}") } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/IcsImporter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/IcsImporter.kt index 2e4eccdea..f91e3f1ee 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/IcsImporter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/IcsImporter.kt @@ -64,9 +64,9 @@ class IcsImporter { curEnd = curStart + decodeTime(duration) } else if (line.startsWith(SUMMARY) && !isNotificationDescription) { curTitle = line.substring(SUMMARY.length) - curTitle = getTitle(curTitle) + curTitle = getTitle(curTitle).replace("\\n", "\n") } else if (line.startsWith(DESCRIPTION) && !isNotificationDescription) { - curDescription = line.substring(DESCRIPTION.length) + curDescription = line.substring(DESCRIPTION.length).replace("\\n", "\n") } else if (line.startsWith(UID)) { curImportId = line.substring(UID.length) } else if (line.startsWith(RRULE)) {