[Jcardcal] "unknown" in jCal?

Philipp Kewisch <kewisch@gmail.com> Fri, 04 April 2014 10:47 UTC

Return-Path: <kewisch@gmail.com>
X-Original-To: jcardcal@ietfa.amsl.com
Delivered-To: jcardcal@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0CA4B1A010E for <jcardcal@ietfa.amsl.com>; Fri, 4 Apr 2014 03:47:23 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_PASS=-0.001] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OfgOd3Oz8LvE for <jcardcal@ietfa.amsl.com>; Fri, 4 Apr 2014 03:47:18 -0700 (PDT)
Received: from mail-bk0-x230.google.com (mail-bk0-x230.google.com [IPv6:2a00:1450:4008:c01::230]) by ietfa.amsl.com (Postfix) with ESMTP id AA0841A0048 for <jcardcal@ietf.org>; Fri, 4 Apr 2014 03:47:17 -0700 (PDT)
Received: by mail-bk0-f48.google.com with SMTP id mx12so269361bkb.7 for <jcardcal@ietf.org>; Fri, 04 Apr 2014 03:47:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type; bh=ISgFrX6ZYrskfwF+egLyeLJPtUX97+6j6kClY2aM1Mw=; b=iRDL8dHI518EgWkPSTrL6f/bdWSDSLNTdeibHb48ormR7+bxNUpyH7rsXKMwwG18u1 E1cXUONAe9o+mmYhX0TJTHlrDvWZSBRIi28tFf/E5Wo8XdUpXuD5dfcVZowD7vjLU/Lj EhJmXWjQQLN8fQSqjYStGPmpS1LSrxVDEYHDfKw2EOfWV9AA7MB6bIEzX+zYvQi3HiXa fa2LtPQOKEfZiAfPgt79o5Gjk9mliJK6PDaLAY56SmpLRbzat59Y2t/cG7T9NNUfLJw/ IUZHVKahWQrCqBjkkBAul3LerneL1y5AWsRscerPZPkxZNIQPgc8JfjJz/S+mgVBmZWa xPwA==
X-Received: by 10.204.241.131 with SMTP id le3mr7861975bkb.0.1396608432591; Fri, 04 Apr 2014 03:47:12 -0700 (PDT)
Received: from [192.168.2.104] (p5DC1549E.dip0.t-ipconnect.de. [93.193.84.158]) by mx.google.com with ESMTPSA id ew15sm8165743bkb.1.2014.04.04.03.47.10 for <multiple recipients> (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Apr 2014 03:47:11 -0700 (PDT)
Message-ID: <533E8DAD.7080603@gmail.com>
Date: Fri, 04 Apr 2014 12:47:09 +0200
From: Philipp Kewisch <kewisch@gmail.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:28.0) Gecko/20100101 Thunderbird/28.0
MIME-Version: 1.0
To: Cyrus Daboo <cyrus@daboo.name>, "jcardcal@ietf.org" <jcardcal@ietf.org>
X-Enigmail-Version: 1.6
Content-Type: multipart/alternative; boundary="------------070608080904000809030300"
Archived-At: http://mailarchive.ietf.org/arch/msg/jcardcal/LYAdY5a9_bAr9DHdI0BOniWYjt0
Subject: [Jcardcal] "unknown" in jCal?
X-BeenThere: jcardcal@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: JSON data formats for vCard and iCalendar WG <jcardcal.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/jcardcal>, <mailto:jcardcal-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/jcardcal/>
List-Post: <mailto:jcardcal@ietf.org>
List-Help: <mailto:jcardcal-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/jcardcal>, <mailto:jcardcal-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 04 Apr 2014 10:47:23 -0000

Hey Folks,

I'm currently trying to handle the "unknown" type in my library and
could use a second opinion if I am doing the right thing. I know why we
need this type, but I'm having a little trouble adhering to both jCal
and iCalendar:

rfc5545 mentions that both IANA and X-props have the default type
"TEXT". This would mean, in theory, that I could just make "text" the
default for all unknown props. Then we found that this does not work
since text escaping might be applied for IANA props registered but not
known to the parser. This means that for jCal I have to ignore that the
default type for IANA props is TEXT and use "unknown" instead. As
X-props are not registered with the IANA, they should in theory always
have a VALUE parameter. In the real world this isn't always the case, so
I have to assume that X-props are also "unknown" unless my parser knows
about them.

So in short:
* Keep a map of all known property names to their default type. Include
props in 5545, any extensions I know of and commonly used x-props.
* Provide a way for the consumer of my library to register new design data.
* Anything that is not in this map should be translated as "unknown"
when converting from iCalendar to jCal

Is this the right way to handle it? If so, I guess a line saying to
ignore the fact that X- and IANA props are said to be TEXT values in
5545 would have helped me.

Philipp