Subject: [Jcardcal] "unknown" in jCal?

From: Philipp Kewisch <[email-masked]>
Date: Fri, 04 Apr 2014 12:47:09 +0200

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