[caldeveloper-l] vCard / iCalendar handling of invalid escape sequences

Marten Gajda marten at dmfs.org
Wed Mar 1 02:26:16 PST 2017


Hi all,

I'm curious how other vCard/iCalendar implementations handle illegal
escape sequences.

I've seen quite a couple of vCards that contained "\r" and (very rarely)
other escaped chars (which could also be a result of not escaping "\"
itself).

I see five options:

1) Keep the escape sequence as is: "\r"

2) Remove the "\" char and keep the escaped char: "r"

3) Remove the entire sequence: ""

4) Stop parsing and throw an error

5) Special case some well-known escape sequences (i.e. do 3 for "\r" and
2 for all others)

My preference is 4 (because technically such a document is invalid), but
in the interest of the user it's probably better to go with 2 (which is
what we currently do).

A similar issue is handling of unescaped list delimiters in non-list
values, e.g. an unescaped "," in a URL or ATTACH property. The vCard and
iCalendar RFCs explicitly state that "," must always be escaped, even in
non-list property values.

It's probably sane to tolerate these, but I'm curious if there are any
implementations which explicitly validate these values and throw an
error if there is an unescaped "," in a non-list value.

Cheers,

Marten

-- 
Marten Gajda
CEO

dmfs GmbH
Schandauer Straße 34
01309 Dresden
GERMANY

phone: +49 177 4427167
email: marten at dmfs.org

Managing Director: Marten Gajda
Registered address: Dresden
Registered No.: AG Dresden HRB 34881
VAT Reg. No.: DE303248743




More information about the caldeveloper-l mailing list