7Internet Engineering Task Force (IETF) C. Daboo
8Request for Comments: 6868 Apple
9Updates: 5545, 6321, 6350, 6351 February 2013
10Category: Standards Track
14 Parameter Value Encoding in iCalendar and vCard
18 This specification updates the data formats for iCalendar (RFC 5545)
19 and vCard (RFC 6350) to allow parameter values to include certain
20 characters forbidden by the existing specifications.
24 This is an Internet Standards Track document.
26 This document is a product of the Internet Engineering Task Force
27 (IETF). It represents the consensus of the IETF community. It has
28 received public review and has been approved for publication by the
29 Internet Engineering Steering Group (IESG). Further information on
30 Internet Standards is available in Section 2 of RFC 5741.
32 Information about the current status of this document, any errata,
33 and how to provide feedback on it may be obtained at
34 http://www.rfc-editor.org/info/rfc6868.
38 Copyright (c) 2013 IETF Trust and the persons identified as the
39 document authors. All rights reserved.
41 This document is subject to BCP 78 and the IETF Trust's Legal
42 Provisions Relating to IETF Documents
43 (http://trustee.ietf.org/license-info) in effect on the date of
44 publication of this document. Please review these documents
45 carefully, as they describe your rights and restrictions with respect
46 to this document. Code Components extracted from this document must
47 include Simplified BSD License text as described in Section 4.e of
48 the Trust Legal Provisions and are provided without warranty as
49 described in the Simplified BSD License.
58Daboo Standards Track [Page 1]
60RFC 6868 Parameter Encoding February 2013
65 1. Introduction ....................................................2
66 2. Conventions Used in This Document ...............................2
67 3. Parameter Value Encoding Scheme .................................3
68 3.1. iCalendar Example ..........................................4
69 3.2. vCard Example ..............................................4
70 4. Security Considerations .........................................4
71 5. Acknowledgments .................................................4
72 6. Normative References ............................................5
73 Appendix A. Choice of Quoting Mechanism ............................6
77 The iCalendar [RFC5545] specification defines a standard way to
78 describe calendar data. The vCard [RFC6350] specification defines a
79 standard way to describe contact data. Both of these use a similar
80 text-based data format. Each iCalendar and vCard data object can
81 include "properties" that have "parameters" and a "value". The value
82 of a "parameter" is typically a token or URI value, but a "generic"
83 text value is also allowed. However, the syntax rules for both
84 iCalendar and vCard prevent the use of a double-quote character or
85 control characters in such values, though double-quote characters and
86 some subset of control characters are allowed in the actual property
89 As more and more extensions are being developed for these data
90 formats, there is a need to allow at least double-quotes and line
91 feeds to be included in parameter values. The \-escaping mechanism
92 used for property text values is not defined for use with parameter
93 values and cannot be easily used in a backwards-compatible manner.
94 This specification defines a new character escaping mechanism,
95 compatible with existing parsers and chosen to minimize any impact on
982. Conventions Used in This Document
100 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
101 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
102 "OPTIONAL" in this document are to be interpreted as described in
114Daboo Standards Track [Page 2]
116RFC 6868 Parameter Encoding February 2013
1193. Parameter Value Encoding Scheme
121 This specification defines the ^ character (U+005E -- Circumflex
122 Accent) as an escape character in parameter values whose value type
123 is defined using the "param-value" syntax element (Section 3.1 of
124 iCalendar [RFC5545] and Section 3.3 of vCard [RFC6350]). The
125 ^-escaping mechanism can be used when the value is either unquoted or
126 quoted (i.e., whether or not the value is surrounded by double-
129 When generating iCalendar or vCard parameter values, the following
132 o formatted text line breaks are encoded into ^n (U+005E, U+006E)
134 o the ^ character (U+005E) is encoded into ^^ (U+005E, U+005E)
136 o the " character (U+0022) is encoded into ^' (U+005E, U+0027)
138 When parsing iCalendar or vCard parameter values, the following
141 o the character sequence ^n (U+005E, U+006E) is decoded into an
142 appropriate formatted line break according to the type of system
145 o the character sequence ^^ (U+005E, U+005E) is decoded into the ^
148 o the character sequence ^' (U+005E, U+0027) is decoded into the "
151 o if a ^ (U+005E) character is followed by any character other than
152 the ones above, parsers MUST leave both the ^ and the following
155 When converting between iCalendar and vCard text-based data formats
156 and alternative data-format representations such as XML (as described
157 in [RFC6321] and [RFC6351], respectively), implementations MUST
158 ensure that parameter value escape sequences are generated correctly
159 in the text-based format and are decoded when the parameter values
160 appear in the alternate data formats.
170Daboo Standards Track [Page 3]
172RFC 6868 Parameter Encoding February 2013
1753.1. iCalendar Example
177 The following example is an "ATTENDEE" property with a "CN" parameter
178 whose value includes two double-quote characters. The parameter
179 value is not quoted, as there are no characters in the value that
180 would trigger quoting as required by iCalendar.
182 ATTENDEE;CN=George Herman ^'Babe^' Ruth:mailto:babe@example.com
184 The unescaped parameter value is
186 George Herman "Babe" Ruth
190 The following example is a "GEO" property with an "X-ADDRESS"
191 parameter whose value includes several line feed characters. The
192 parameter value is also quoted, since it contains a comma, which
193 triggers quoting as required by vCard.
195 GEO;X-ADDRESS="Pittsburgh Pirates^n115 Federal St^nPitt
196 sburgh, PA 15212":geo:40.446816,-80.00566
198 The unescaped parameter value (where each line is terminated by a
199 line break character sequence) is
2054. Security Considerations
207 There are no additional security issues beyond those of iCalendar
208 [RFC5545] and vCard [RFC6350].
212 Thanks to Michael Angstadt, Tim Bray, Mike Douglass, Barry Leiba,
213 Simon Perreault, and Pete Resnick for feedback on this specification.
226Daboo Standards Track [Page 4]
228RFC 6868 Parameter Encoding February 2013
2316. Normative References
233 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
234 Requirement Levels", BCP 14, RFC 2119, March 1997.
236 [RFC5545] Desruisseaux, B., "Internet Calendaring and Scheduling
237 Core Object Specification (iCalendar)", RFC 5545,
240 [RFC6321] Daboo, C., Douglass, M., and S. Lees, "xCal: The XML
241 Format for iCalendar", RFC 6321, August 2011.
243 [RFC6350] Perreault, S., "vCard Format Specification", RFC 6350,
246 [RFC6351] Perreault, S., "xCard: vCard XML Representation",
247 RFC 6351, August 2011.
282Daboo Standards Track [Page 5]
284RFC 6868 Parameter Encoding February 2013
287Appendix A. Choice of Quoting Mechanism
289 Having recognized the need for escaping parameter values, the
290 question is what mechanism to use? One obvious choice would be to
291 adopt the \-escaping used for property values. However, that could
292 not be used as-is, because it escapes a double-quote as the sequence
293 of \ followed by double-quote. Consider what the example in
294 Section 3.1 might look like using \-escaping:
296 ATTENDEE;CN="George Herman \"Babe\" Ruth":mailto:babe@example.com
298 Existing iCalendar/vCard parsers know nothing about escape sequences
299 in parameters. So they would parse the parameter value as:
303 i.e., the text between the first and second occurrence of a double-
304 quote. However, the text after the second double-quote ought to be
305 either a : or a ; (to delimit the parameter value from the following
306 parameter or property) but is not, so the parser could legitimately
307 throw an error at that point because the data is syntactically
308 invalid. Thus, for backwards-compatibility reasons, a double-quote
309 cannot be escaped using a sequence that itself includes a double-
310 quote, and hence the choice of using a single-quote in this
313 Another option would be to use a form of \-escaping modified for use
314 in parameter values only. However, some incorrect, non-interoperable
315 use of \ in parameter values has been observed, and thus it is best
316 to steer clear of that to achieve guaranteed, reliable
317 interoperability. Also, given that double-quote gets changed to
318 single-quote in the escape sequence for a parameter, but not for a
319 value, it is better to not give the impression that the same escape
320 mechanism (and thus code) can be used for both (which could lead to
321 other issues, such as an implementation incorrectly escaping a ; as
322 \; as opposed to quoting the parameter value).
324 The choice of ^ as the escape character was made based on the
325 requirement that an ASCII symbol (non-alphanumeric character) be
326 used, and it ought to be one least likely to be found in existing
338Daboo Standards Track [Page 6]
340RFC 6868 Parameter Encoding February 2013
351 EMail: cyrus@daboo.name
352 URI: http://www.apple.com/
394Daboo Standards Track [Page 7]