[VCARDDAV] Escaping dquote in a parameter value

Cyrus Daboo <cyrus@daboo.name> Wed, 20 June 2012 02:56 UTC

Return-Path: <cyrus@daboo.name>
X-Original-To: vcarddav@ietfa.amsl.com
Delivered-To: vcarddav@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5CF1B11E80A3; Tue, 19 Jun 2012 19:56:25 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -102.599
X-Spam-Level:
X-Spam-Status: No, score=-102.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id d37ma9f0MWvq; Tue, 19 Jun 2012 19:56:24 -0700 (PDT)
Received: from daboo.name (daboo.name [173.13.55.49]) by ietfa.amsl.com (Postfix) with ESMTP id 79EC711E808E; Tue, 19 Jun 2012 19:56:24 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by daboo.name (Postfix) with ESMTP id C204829B2621; Tue, 19 Jun 2012 22:56:23 -0400 (EDT)
X-Virus-Scanned: amavisd-new at daboo.name
Received: from daboo.name ([127.0.0.1]) by localhost (daboo.name [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JVqqm6ylMM+m; Tue, 19 Jun 2012 22:56:22 -0400 (EDT)
Received: from [10.0.1.8] (unknown [173.13.55.49]) by daboo.name (Postfix) with ESMTPSA id 4D91C29B2616; Tue, 19 Jun 2012 22:56:22 -0400 (EDT)
Date: Tue, 19 Jun 2012 22:56:34 -0400
From: Cyrus Daboo <cyrus@daboo.name>
To: vcarddav@ietf.org, Calsify <calsify@ietf.org>
Message-ID: <50174924F12AC68AE58D5384@cyrus.local>
X-Mailer: Mulberry/4.1.0a3 (Mac OS X)
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"; format="flowed"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; size="1664"
Subject: [VCARDDAV] Escaping dquote in a parameter value
X-BeenThere: vcarddav@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: IETF vcarddav wg mailing list <vcarddav.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/vcarddav>, <mailto:vcarddav-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/vcarddav>
List-Post: <mailto:vcarddav@ietf.org>
List-Help: <mailto:vcarddav-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/vcarddav>, <mailto:vcarddav-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Jun 2012 02:56:25 -0000

Hi,
As I am sure most people are aware, a double-quote character is forbidden 
to appear in a parameter value in both vCard and iCalendar. Yet there is a 
need to preserve double-quotes in a parameter value. So I am going to 
propose an extension to the specifications whereby a new escape mechanism 
is introduced solely for the purpose of allowing d-quote in a parameter 
value in a backwards compatible manner.

My proposal is to use ^ (0x5e) as an escape character, with only the 
following two sequences allowed:

^^ - represents a single ^ character
^' - represents a single d-quote character

I ruled out use of \ because some parsers erroneously eat that, and it 
would also be tempting to use \" which is definitely not possible because 
the dquote cannot appear.

I also ruled out & (XML/HTML entity style) and % (URI style) style escaping 
as being too general - we don't need to escape arbitrary characters - only 
dquote. Also, I think & and % are already in common use in parameter values 
that have URIs, so would end up being escaped themselves a lot more. I 
suspect ^ is one of the least used characters and so the need to escape the 
escape character is less.

Obviously there would need to be some backwards compatibility statement in 
regard to what to do with existing values with a single ^. I would suggest 
any combination that is not one of the above two, should be left alone when 
parsing. But when generating, it would be escaped as ^^.

There are probably some other ascii symbols that are infrequently used too, 
that we could pick if there are strong arguments against ^, but for now I 
am happy with ^.

Thoughts?

-- 
Cyrus Daboo