can/should iCal property parametrs be escaped?
Asked Answered
C

1

14

specifically, the CN (common name) parameter, e.g.

ORGANIZER;CN=John Doe,Eng:mailto:[email protected]

The RFC is vague on this, IMHO. It is very clear about property values of type TEXT, but for this parameter it just says "The parameter value is text". Anyways, the escaping specified for TEXT type doesn't seem complete for parameter values (e.g. ':' is not escaped).

thanks a lot!

Citizenry answered 10/6, 2010 at 12:6 Comment(0)
A
21

Davka,

Yes, parameter values can be escaped by surrounding the value in double-quotes. Parameter values must be escaped if they contain any of the following characters:

; - semicolon
: - colon
, - comma

It is illegal to have a double quote " character inside parameter values, so they should be deleted (or otherwise removed from the parameter value).

So, with your above example, the correct escaping is this:

ORGANIZER;CN="John Doe,Eng":mailto:[email protected]

Note that once the first (unquoted) colon : is encountered, parsing engines treat the rest as the property value. It is legal to use the colon : character inside property values, so the colon in mailto:[email protected] doesn't need to be escaped.

We can break the line into it's parts:

  • ORGANIZER - property name
  • ; - parameter delimiter
  • CN - parameter name
  • = - parameter value delimiter
  • "John Doe,Eng" - parameter value
  • : - property value delimiter
  • mailto:[email protected] - property value

Here's a quote from RFC 5545 Section 3.2 that explains when parameter values are surrounded with double-quotes, and tells us double-quotes are illegal in parameter values:

Property parameter values that contain the COLON, SEMICOLON, or COMMA character separators MUST be specified as quoted-string text values. Property parameter values MUST NOT contain the DQUOTE character. The DQUOTE character is used as a delimiter for parameter values that contain restricted characters or URI text. For example:

DESCRIPTION;ALTREP="cid:[email protected]":The Fall'98 Wild Wizards Conference - - Las Vegas\, NV\, USA

It's important to note that parameters can technically contain multiple values. A comma is used to separate these multiple values:

(from Section 3.2.11 of RFC 5545:)

ATTENDEE;MEMBER="mailto:[email protected]","mailto:pr
 [email protected]":mailto:[email protected]

Not all iCalendar engines will accept multiple values on all parameters, but the following parameters SHOULD allow multiple values (according to the RFC):

  • MEMBER
  • DELEGATED-FROM
  • DELEGATED-TO

Regards,

-Doug

Abie answered 10/8, 2010 at 22:38 Comment(3)
I couldn't make the comma approach work in Outlook 2013 and just ended up specifying multiple ATTENDEE lines.Lardaceous
Yep, that's as intended. The comma approach is to provide multiple aliases for the same person (i.e. a person with multiple e-mail addresses).Abie
According to RFC6868, you can escape " to ^' so it is no longer illegal to have a double quote inside parameter values now.Dol

© 2022 - 2024 — McMap. All rights reserved.