6868
PROPOSED STANDARD

Parameter Value Encoding in iCalendar and vCard

Authors: C. Daboo
Date: February 2013
Working Group: NON WORKING GROUP
Stream: IETF
Updates: RFC 5545

Abstract

This specification updates the data formats for iCalendar (RFC 5545) and vCard (RFC 6350) to allow parameter values to include certain characters forbidden by the existing specifications.

RFC 6868: Parameter Value Encoding in iCalendar and vCard [RFC Home] [TEXT|PDF|HTML] [Tracker] [IPR] [Errata] [Info page]

PROPOSED STANDARD
Errata Exist
Internet Engineering Task Force (IETF)                          C. Daboo
Request for Comments: 6868                                         Apple
Updates: <a href="./rfc5545">5545</a>, <a href="./rfc6321">6321</a>, <a href="./rfc6350">6350</a>, <a href="./rfc6351">6351</a>                            February 2013
Category: Standards Track
ISSN: 2070-1721


            <span class="h1">Parameter Value Encoding in iCalendar and vCard</span>

Abstract

   This specification updates the data formats for iCalendar (<a href="./rfc5545">RFC 5545</a>)
   and vCard (<a href="./rfc6350">RFC 6350</a>) to allow parameter values to include certain
   characters forbidden by the existing specifications.

Status of This Memo

   This is an Internet Standards Track document.

   This document is a product of the Internet Engineering Task Force
   (IETF).  It represents the consensus of the IETF community.  It has
   received public review and has been approved for publication by the
   Internet Engineering Steering Group (IESG).  Further information on
   Internet Standards is available in <a href="./rfc5741#section-2">Section 2 of RFC 5741</a>.

   Information about the current status of this document, any errata,
   and how to provide feedback on it may be obtained at
   <a href="https://www.rfc-editor.org/info/rfc6868">http://www.rfc-editor.org/info/rfc6868</a>.

Copyright Notice

   Copyright (c) 2013 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to <a href="https://www.rfc-editor.org/bcp/bcp78">BCP 78</a> and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (<a href="http://trustee.ietf.org/license-info">http://trustee.ietf.org/license-info</a>) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.








<span class="grey">Daboo                        Standards Track                    [Page 1]</span>

<span id="page-2" ></span>
<span class="grey"><a href="./rfc6868">RFC 6868</a>                   Parameter Encoding              February 2013</span>


Table of Contents

   <a href="#section-1">1</a>. Introduction ....................................................<a href="#page-2">2</a>
   <a href="#section-2">2</a>. Conventions Used in This Document ...............................<a href="#page-2">2</a>
   <a href="#section-3">3</a>. Parameter Value Encoding Scheme .................................<a href="#page-3">3</a>
      <a href="#section-3.1">3.1</a>. iCalendar Example ..........................................<a href="#page-4">4</a>
      <a href="#section-3.2">3.2</a>. vCard Example ..............................................<a href="#page-4">4</a>
   <a href="#section-4">4</a>. Security Considerations .........................................<a href="#page-4">4</a>
   <a href="#section-5">5</a>. Acknowledgments .................................................<a href="#page-4">4</a>
   <a href="#section-6">6</a>. Normative References ............................................<a href="#page-5">5</a>
   <a href="#appendix-A">Appendix A</a>. Choice of Quoting Mechanism ............................<a href="#page-6">6</a>

<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>.  Introduction</span>

   The iCalendar [<a href="./rfc5545" title=""Internet Calendaring and Scheduling Core Object Specification (iCalendar)"">RFC5545</a>] specification defines a standard way to
   describe calendar data.  The vCard [<a href="./rfc6350" title=""vCard Format Specification"">RFC6350</a>] specification defines a
   standard way to describe contact data.  Both of these use a similar
   text-based data format.  Each iCalendar and vCard data object can
   include "properties" that have "parameters" and a "value".  The value
   of a "parameter" is typically a token or URI value, but a "generic"
   text value is also allowed.  However, the syntax rules for both
   iCalendar and vCard prevent the use of a double-quote character or
   control characters in such values, though double-quote characters and
   some subset of control characters are allowed in the actual property
   values.

   As more and more extensions are being developed for these data
   formats, there is a need to allow at least double-quotes and line
   feeds to be included in parameter values.  The \-escaping mechanism
   used for property text values is not defined for use with parameter
   values and cannot be easily used in a backwards-compatible manner.
   This specification defines a new character escaping mechanism,
   compatible with existing parsers and chosen to minimize any impact on
   existing data.

<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>.  Conventions Used in This Document</span>

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
   "OPTIONAL" in this document are to be interpreted as described in
   [<a href="./rfc2119" title=""Key words for use in RFCs to Indicate Requirement Levels"">RFC2119</a>].










<span class="grey">Daboo                        Standards Track                    [Page 2]</span>

<span id="page-3" ></span>
<span class="grey"><a href="./rfc6868">RFC 6868</a>                   Parameter Encoding              February 2013</span>


<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>.  Parameter Value Encoding Scheme</span>

   This specification defines the ^ character (U+005E -- Circumflex
   Accent) as an escape character in parameter values whose value type
   is defined using the "param-value" syntax element (<a href="#section-3.1">Section 3.1</a> of
   iCalendar [<a href="./rfc5545" title=""Internet Calendaring and Scheduling Core Object Specification (iCalendar)"">RFC5545</a>] and <a href="#section-3.3">Section 3.3</a> of vCard [<a href="./rfc6350" title=""vCard Format Specification"">RFC6350</a>]).  The
   ^-escaping mechanism can be used when the value is either unquoted or
   quoted (i.e., whether or not the value is surrounded by double-
   quotes).

   When generating iCalendar or vCard parameter values, the following
   apply:

   o  formatted text line breaks are encoded into ^n (U+005E, U+006E)

   o  the ^ character (U+005E) is encoded into ^^ (U+005E, U+005E)

   o  the " character (U+0022) is encoded into ^' (U+005E, U+0027)

   When parsing iCalendar or vCard parameter values, the following
   apply:

   o  the character sequence ^n (U+005E, U+006E) is decoded into an
      appropriate formatted line break according to the type of system
      being used

   o  the character sequence ^^ (U+005E, U+005E) is decoded into the ^
      character (U+005E)

   o  the character sequence ^' (U+005E, U+0027) is decoded into the "
      character (U+0022)

   o  if a ^ (U+005E) character is followed by any character other than
      the ones above, parsers MUST leave both the ^ and the following
      character in place

   When converting between iCalendar and vCard text-based data formats
   and alternative data-format representations such as XML (as described
   in [<a href="./rfc6321" title=""xCal: The XML Format for iCalendar"">RFC6321</a>] and [<a href="./rfc6351" title=""xCard: vCard XML Representation"">RFC6351</a>], respectively), implementations MUST
   ensure that parameter value escape sequences are generated correctly
   in the text-based format and are decoded when the parameter values
   appear in the alternate data formats.









<span class="grey">Daboo                        Standards Track                    [Page 3]</span>

<span id="page-4" ></span>
<span class="grey"><a href="./rfc6868">RFC 6868</a>                   Parameter Encoding              February 2013</span>


<span class="h3"><a class="selflink" id="section-3.1" href="#section-3.1">3.1</a>.  iCalendar Example</span>

   The following example is an "ATTENDEE" property with a "CN" parameter
   whose value includes two double-quote characters.  The parameter
   value is not quoted, as there are no characters in the value that
   would trigger quoting as required by iCalendar.

   ATTENDEE;CN=George Herman ^'Babe^' Ruth:mailto:[email protected]

   The unescaped parameter value is

   George Herman "Babe" Ruth

<span class="h3"><a class="selflink" id="section-3.2" href="#section-3.2">3.2</a>.  vCard Example</span>

   The following example is a "GEO" property with an "X-ADDRESS"
   parameter whose value includes several line feed characters.  The
   parameter value is also quoted, since it contains a comma, which
   triggers quoting as required by vCard.

   GEO;X-ADDRESS="Pittsburgh Pirates^n115 Federal St^nPitt
    sburgh, PA 15212":geo:40.446816,-80.00566

   The unescaped parameter value (where each line is terminated by a
   line break character sequence) is

   Pittsburgh Pirates
   115 Federal St
   Pittsburgh, PA 15212

<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>.  Security Considerations</span>

   There are no additional security issues beyond those of iCalendar
   [<a href="./rfc5545" title=""Internet Calendaring and Scheduling Core Object Specification (iCalendar)"">RFC5545</a>] and vCard [<a href="./rfc6350" title=""vCard Format Specification"">RFC6350</a>].

<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>.  Acknowledgments</span>

   Thanks to Michael Angstadt, Tim Bray, Mike Douglass, Barry Leiba,
   Simon Perreault, and Pete Resnick for feedback on this specification.












<span class="grey">Daboo                        Standards Track                    [Page 4]</span>

<span id="page-5" ></span>
<span class="grey"><a href="./rfc6868">RFC 6868</a>                   Parameter Encoding              February 2013</span>


<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>.  Normative References</span>

   [<a id="ref-RFC2119">RFC2119</a>]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>, March 1997.

   [<a id="ref-RFC5545">RFC5545</a>]  Desruisseaux, B., "Internet Calendaring and Scheduling
              Core Object Specification (iCalendar)", <a href="./rfc5545">RFC 5545</a>,
              September 2009.

   [<a id="ref-RFC6321">RFC6321</a>]  Daboo, C., Douglass, M., and S. Lees, "xCal: The XML
              Format for iCalendar", <a href="./rfc6321">RFC 6321</a>, August 2011.

   [<a id="ref-RFC6350">RFC6350</a>]  Perreault, S., "vCard Format Specification", <a href="./rfc6350">RFC 6350</a>,
              August 2011.

   [<a id="ref-RFC6351">RFC6351</a>]  Perreault, S., "xCard: vCard XML Representation",
              <a href="./rfc6351">RFC 6351</a>, August 2011.


































<span class="grey">Daboo                        Standards Track                    [Page 5]</span>

<span id="page-6" ></span>
<span class="grey"><a href="./rfc6868">RFC 6868</a>                   Parameter Encoding              February 2013</span>


<span class="h2"><a class="selflink" id="appendix-A" href="#appendix-A">Appendix A</a>.  Choice of Quoting Mechanism</span>

   Having recognized the need for escaping parameter values, the
   question is what mechanism to use?  One obvious choice would be to
   adopt the \-escaping used for property values.  However, that could
   not be used as-is, because it escapes a double-quote as the sequence
   of \ followed by double-quote.  Consider what the example in
   <a href="#section-3.1">Section 3.1</a> might look like using \-escaping:

   ATTENDEE;CN="George Herman \"Babe\" Ruth":mailto:[email protected]

   Existing iCalendar/vCard parsers know nothing about escape sequences
   in parameters.  So they would parse the parameter value as:

   George Herman \

   i.e., the text between the first and second occurrence of a double-
   quote.  However, the text after the second double-quote ought to be
   either a : or a ; (to delimit the parameter value from the following
   parameter or property) but is not, so the parser could legitimately
   throw an error at that point because the data is syntactically
   invalid.  Thus, for backwards-compatibility reasons, a double-quote
   cannot be escaped using a sequence that itself includes a double-
   quote, and hence the choice of using a single-quote in this
   specification.

   Another option would be to use a form of \-escaping modified for use
   in parameter values only.  However, some incorrect, non-interoperable
   use of \ in parameter values has been observed, and thus it is best
   to steer clear of that to achieve guaranteed, reliable
   interoperability.  Also, given that double-quote gets changed to
   single-quote in the escape sequence for a parameter, but not for a
   value, it is better to not give the impression that the same escape
   mechanism (and thus code) can be used for both (which could lead to
   other issues, such as an implementation incorrectly escaping a ; as
   \; as opposed to quoting the parameter value).

   The choice of ^ as the escape character was made based on the
   requirement that an ASCII symbol (non-alphanumeric character) be
   used, and it ought to be one least likely to be found in existing
   data.










<span class="grey">Daboo                        Standards Track                    [Page 6]</span>

<span id="page-7" ></span>
<span class="grey"><a href="./rfc6868">RFC 6868</a>                   Parameter Encoding              February 2013</span>


Author's Address

   Cyrus Daboo
   Apple Inc.
   1 Infinite Loop
   Cupertino, CA  95014
   USA

   EMail: [email protected]
   URI:   <a href="http://www.apple.com/">http://www.apple.com/</a>









































Daboo                        Standards Track                    [Page 7]

Additional Resources