From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>
Received: from mp12.migadu.com ([2001:41d0:8:6d80::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms9.migadu.com with LMTPS
	id +JxKL0XrJ2TlQgAASxT56A
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Sat, 01 Apr 2023 10:28:53 +0200
Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp12.migadu.com with LMTPS
	id mB44L0XrJ2R+lQAAauVa8A
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Sat, 01 Apr 2023 10:28:53 +0200
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by aspmx1.migadu.com (Postfix) with ESMTPS id 5B51122413
	for <larch@yhetil.org>; Sat,  1 Apr 2023 10:28:53 +0200 (CEST)
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <emacs-orgmode-bounces@gnu.org>)
	id 1piWay-00064D-AH; Sat, 01 Apr 2023 04:28:20 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <yantar92@posteo.net>)
 id 1piWav-000642-56
 for emacs-orgmode@gnu.org; Sat, 01 Apr 2023 04:28:18 -0400
Received: from mout02.posteo.de ([185.67.36.66])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <yantar92@posteo.net>)
 id 1piWar-0006Z3-1T
 for emacs-orgmode@gnu.org; Sat, 01 Apr 2023 04:28:15 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 92B15240635
 for <emacs-orgmode@gnu.org>; Sat,  1 Apr 2023 10:28:10 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1680337690; bh=bkV9Wkw5fhOwSP9O2ADIIAHg9oFrIT2zSWVON2+d7PM=;
 h=From:To:Cc:Subject:Date:From;
 b=hqfNHBUdTrDvxE8V98MJUGGHcFk1VsXfgPhhKenrhGYHa2OojX5jM7200asQsBKa/
 f/uSDtMVukfxMtRpOAa4A5lw45OTHFBAWmutF5pSNAB44ULMcq16uiOAK1ROhKzLIf
 96TUewNhKd9lvYtb/KEiYc5tktlRyrJWvvywpeqEBvdtw/urHgcMau73jCPVlag7c0
 g5renPCdqmRR29phdmYegzHUnAHWj1J29FEUUssBTO6LWueV2wXygiJeQ1KN39t7IW
 yIrd2UDNMx/8jnaVn9MF+L3zVGEA6Dop5I3TDso7c+JAX3yt2kK15uLlKa4Z6oo1xP
 de7WXhkmZohzg==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4PpVfL0MQVz9rxB;
 Sat,  1 Apr 2023 10:28:10 +0200 (CEST)
From: Ihor Radchenko <yantar92@posteo.net>
To: Jack Kamm <jackkamm@gmail.com>
Cc: emacs-orgmode@gnu.org, mail@nicolasgoaziou.fr
Subject: Re: [RFC] ox-icalendar: Unscheduled tasks & repeating tasks
In-Reply-To: <87jzywk1fs.fsf@gmail.com>
References: <874jq75okg.fsf@gmail.com> <87o7oetneo.fsf@localhost>
 <87r0t5jwgy.fsf@gmail.com> <87v8ih9ihw.fsf@localhost>
 <87o7o8kji5.fsf@gmail.com> <87fs9kajx7.fsf@localhost>
 <87jzywk1fs.fsf@gmail.com>
Date: Sat, 01 Apr 2023 08:30:26 +0000
Message-ID: <87tty0f1i5.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net;
 helo=mout02.posteo.de
X-Spam_score_int: -43
X-Spam_score: -4.4
X-Spam_bar: ----
X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-BeenThere: emacs-orgmode@gnu.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "General discussions about Org-mode." <emacs-orgmode.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/emacs-orgmode>
List-Post: <mailto:emacs-orgmode@gnu.org>
List-Help: <mailto:emacs-orgmode-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=subscribe>
Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org
Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org
X-Migadu-Country: US
X-Migadu-Flow: FLOW_IN
ARC-Seal: i=1; s=key1; d=yhetil.org; t=1680337733; a=rsa-sha256; cv=none;
	b=fDYL+8Dburx2YGkL/aDcpA2Fw73D9XgNsr6VDsj+KdQo1MYb0lv3REGXPd9v16i4+dJ5eV
	1uC2vJ4yQXmoF59Ob3u3YPErc4YcX4O9yAvjA59TsSIpUYwlgy5hy6/0v+DzwhYRD2XReA
	5jfPPYtFbw9epcOiVrbdM+LIx3wrkssuvlqQZ1siL6skObkKMZe86x+E7/lksCijTS5LPt
	Heg8SKXDHFRwjtLLX5naEeTrcXM92sR+8KfYPBhr77obFBGKdfhT/NVcKdXBiJxvpNznL2
	3Id9L1FDpiqU/NtYlaFNVkXGtpfpQZMhZRylRAWZwr9oltwhNnEGd0jZBqUiVA==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=pass header.d=posteo.net header.s=2017 header.b=hqfNHBUd;
	dmarc=pass (policy=none) header.from=posteo.net;
	spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org;
	s=key1; t=1680337733;
	h=from:from:sender:sender:reply-to:subject:subject:date:date:
	 message-id:message-id:to:to:cc:cc:mime-version:mime-version:
	 content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references:list-id:list-help:
	 list-unsubscribe:list-subscribe:list-post:dkim-signature;
	bh=wpdwVmrfDC+CeZ92LV+dPy30E1GkPB9fxBnqisamSB0=;
	b=oJEY+sWRr9k4SMZsrX92Eol7OGjbJLcs+YV9A/VdSvt0w2hai8kh+Vsqz9RHq7KRS+h5NQ
	3f2qbgmX43qE81eZmrSt3quAonAwcA8o0YX4rRogafzg1fwZ5228eP2Qoce73bDHh/CsyT
	kFbCr5wcYo4aXnG82GprWpIxHpsIKmjPukIyWsnaPGthpCANwUGCw/A2n1Ue7WUFOjehKx
	eJiMlpmsW4H3Y3PuIpijBs1jXTBklhfIJfBMD4G1/FREyLqQPvvo2yOmtS5N0xzKId5Rvr
	Y8iefDudRBYReXXNFKgv9/4+KHTVp+2BNvnOX1kqzheJE7rzU3tsWOr44apyxQ==
X-Migadu-Spam-Score: -6.24
X-Migadu-Scanner: scn1.migadu.com
Authentication-Results: aspmx1.migadu.com;
	dkim=pass header.d=posteo.net header.s=2017 header.b=hqfNHBUd;
	dmarc=pass (policy=none) header.from=posteo.net;
	spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"
X-Spam-Score: -6.24
X-Migadu-Queue-Id: 5B51122413
X-TUID: PcRi9Atmxu5d

Jack Kamm <jackkamm@gmail.com> writes:

> For issue 1, what `org-icalendar-fold-string' does when string already
> contains \r\n, you can see that it produces \r\r\n as follows:
>
> emacs -Q -l ox-icalendar
> M-:
> (org-icalendar-fold-string (org-icalendar-fold-string "Line1\nLine2"))
>
> This is why the patch removes the calls to `org-icalendar-fold-string'
> in `org-icalendar--vevent' and `org-icalendar--vtodo' -- otherwise we
> would add \r multiple times to the same string.
>
> To change this behavior of `org-icalendar-fold-string', we could
> modify the patch to do:
>
>  (defun org-icalendar-fold-string (s)
>    "Fold string S according to RFC 5545."
>    (replace-regexp-in-string
> -   "\n" "\r\n"
> +   "\r*\n" "\r\n"
>
> which would strip out any extra \r at end of line. Another alternative
> would be to use "\r?\n" instead of "\r*\n".

"\r*\n" looks safer.

> For the second issue -- when `org-export-coding-system' is dos (or
> similar), the file created by `org-export-to-file' will contain
> \r\r\n. This was already the pre-existing behavior, but note the patch
> does cause a minor change here: before the patch just the main body
> will have \r\r\n, but after the patch, the preamble will also have it.

I see.
Looking at
https://icalendar.org/iCalendar-RFC-5545/3-1-4-character-set.html:

    There is not a property parameter to declare the charset used in a
    property value. The default charset for an iCalendar stream is UTF-8 as
    defined in [RFC3629].

So, we should probably override `org-export-coding-system', even when it
is set. iCalendar demands UTF8 anyway.

We likely want (according to 34.10.1 Basic Concepts of Coding Systems):

       The coding system =E2=80=98utf-8-emacs=E2=80=99 specifies that the d=
ata is
    represented in the internal Emacs encoding (*note Text
    Representations::).  This is like =E2=80=98raw-text=E2=80=99 in that no=
 code conversion
    happens, but different in that the result is multibyte data.  The name
    =E2=80=98emacs-internal=E2=80=99 is an alias for =E2=80=98utf-8-emacs-u=
nix=E2=80=99 (so it forces no
    conversion of end-of-line, unlike =E2=80=98utf-8-emacs=E2=80=99, which =
can decode all 3
    kinds of end-of-line conventions).

--=20
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>