1
2
3
4
5
6
7Internet Engineering Task Force (IETF) C. Daboo
8Request for Comments: 6868 Apple
9Updates: 5545, 6321, 6350, 6351 February 2013
10Category: Standards Track
11ISSN: 2070-1721
12
13
14 Parameter Value Encoding in iCalendar and vCard
15
16Abstract
17
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.
21
22Status of This Memo
23
24 This is an Internet Standards Track document.
25
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.
31
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.
35
36Copyright Notice
37
38 Copyright (c) 2013 IETF Trust and the persons identified as the
39 document authors. All rights reserved.
40
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.
50
51
52
53
54
55
56
57
58Daboo Standards Track [Page 1]
59
60RFC 6868 Parameter Encoding February 2013
61
62
63Table of Contents
64
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
74
751. Introduction
76
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
87 values.
88
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
96 existing data.
97
982. Conventions Used in This Document
99
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
103 [RFC2119].
104
105
106
107
108
109
110
111
112
113
114Daboo Standards Track [Page 2]
115
116RFC 6868 Parameter Encoding February 2013
117
118
1193. Parameter Value Encoding Scheme
120
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-
127 quotes).
128
129 When generating iCalendar or vCard parameter values, the following
130 apply:
131
132 o formatted text line breaks are encoded into ^n (U+005E, U+006E)
133
134 o the ^ character (U+005E) is encoded into ^^ (U+005E, U+005E)
135
136 o the " character (U+0022) is encoded into ^' (U+005E, U+0027)
137
138 When parsing iCalendar or vCard parameter values, the following
139 apply:
140
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
143 being used
144
145 o the character sequence ^^ (U+005E, U+005E) is decoded into the ^
146 character (U+005E)
147
148 o the character sequence ^' (U+005E, U+0027) is decoded into the "
149 character (U+0022)
150
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
153 character in place
154
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.
161
162
163
164
165
166
167
168
169
170Daboo Standards Track [Page 3]
171
172RFC 6868 Parameter Encoding February 2013
173
174
1753.1. iCalendar Example
176
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.
181
182 ATTENDEE;CN=George Herman ^'Babe^' Ruth:mailto:babe@example.com
183
184 The unescaped parameter value is
185
186 George Herman "Babe" Ruth
187
1883.2. vCard Example
189
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.
194
195 GEO;X-ADDRESS="Pittsburgh Pirates^n115 Federal St^nPitt
196 sburgh, PA 15212":geo:40.446816,-80.00566
197
198 The unescaped parameter value (where each line is terminated by a
199 line break character sequence) is
200
201 Pittsburgh Pirates
202 115 Federal St
203 Pittsburgh, PA 15212
204
2054. Security Considerations
206
207 There are no additional security issues beyond those of iCalendar
208 [RFC5545] and vCard [RFC6350].
209
2105. Acknowledgments
211
212 Thanks to Michael Angstadt, Tim Bray, Mike Douglass, Barry Leiba,
213 Simon Perreault, and Pete Resnick for feedback on this specification.
214
215
216
217
218
219
220
221
222
223
224
225
226Daboo Standards Track [Page 4]
227
228RFC 6868 Parameter Encoding February 2013
229
230
2316. Normative References
232
233 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
234 Requirement Levels", BCP 14, RFC 2119, March 1997.
235
236 [RFC5545] Desruisseaux, B., "Internet Calendaring and Scheduling
237 Core Object Specification (iCalendar)", RFC 5545,
238 September 2009.
239
240 [RFC6321] Daboo, C., Douglass, M., and S. Lees, "xCal: The XML
241 Format for iCalendar", RFC 6321, August 2011.
242
243 [RFC6350] Perreault, S., "vCard Format Specification", RFC 6350,
244 August 2011.
245
246 [RFC6351] Perreault, S., "xCard: vCard XML Representation",
247 RFC 6351, August 2011.
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282Daboo Standards Track [Page 5]
283
284RFC 6868 Parameter Encoding February 2013
285
286
287Appendix A. Choice of Quoting Mechanism
288
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:
295
296 ATTENDEE;CN="George Herman \"Babe\" Ruth":mailto:babe@example.com
297
298 Existing iCalendar/vCard parsers know nothing about escape sequences
299 in parameters. So they would parse the parameter value as:
300
301 George Herman \
302
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
311 specification.
312
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).
323
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
327 data.
328
329
330
331
332
333
334
335
336
337
338Daboo Standards Track [Page 6]
339
340RFC 6868 Parameter Encoding February 2013
341
342
343Author's Address
344
345 Cyrus Daboo
346 Apple Inc.
347 1 Infinite Loop
348 Cupertino, CA 95014
349 USA
350
351 EMail: cyrus@daboo.name
352 URI: http://www.apple.com/
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394Daboo Standards Track [Page 7]
395
396