Re: [apps-discuss] draft-pbryan-zyp-json-pointer: name syntax for non-ASCII

"Paul C. Bryan" <paul.bryan@forgerock.com> Thu, 24 November 2011 17:18 UTC

Return-Path: <paul.bryan@forgerock.com>
X-Original-To: apps-discuss@ietfa.amsl.com
Delivered-To: apps-discuss@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B427D21F8A6C for <apps-discuss@ietfa.amsl.com>; Thu, 24 Nov 2011 09:18:57 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.644
X-Spam-Level:
X-Spam-Status: No, score=-6.644 tagged_above=-999 required=5 tests=[AWL=-0.046, BAYES_00=-2.599, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-4]
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 4rnqmFpfGkHd for <apps-discuss@ietfa.amsl.com>; Thu, 24 Nov 2011 09:18:56 -0800 (PST)
Received: from eu1sys200aog120.obsmtp.com (eu1sys200aog120.obsmtp.com [207.126.144.149]) by ietfa.amsl.com (Postfix) with SMTP id 1725321F8A57 for <apps-discuss@ietf.org>; Thu, 24 Nov 2011 09:18:54 -0800 (PST)
Received: from mail-iy0-f181.google.com ([209.85.210.181]) (using TLSv1) by eu1sys200aob120.postini.com ([207.126.147.11]) with SMTP ID DSNKTs58alomYQaP6q8J5NYR5CSO/hDiZWQ9@postini.com; Thu, 24 Nov 2011 17:18:55 UTC
Received: by iaen33 with SMTP id n33so3816400iae.40 for <apps-discuss@ietf.org>; Thu, 24 Nov 2011 09:18:33 -0800 (PST)
Received: by 10.50.12.227 with SMTP id b3mr33868398igc.24.1322155112073; Thu, 24 Nov 2011 09:18:32 -0800 (PST)
Received: from [192.168.1.3] (S0106a021b762dbb3.vf.shawcable.net. [174.1.40.184]) by mx.google.com with ESMTPS id e2sm89518467ibe.0.2011.11.24.09.18.30 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 24 Nov 2011 09:18:30 -0800 (PST)
Message-ID: <1322155108.2439.10.camel@neutron>
From: "Paul C. Bryan" <paul.bryan@forgerock.com>
To: apps-discuss@ietf.org
Date: Thu, 24 Nov 2011 09:18:28 -0800
In-Reply-To: <4ECDF582.1070703@it.aoyama.ac.jp>
References: <4ECA5C66.1040305@gmx.de> <1321903463.1990.16.camel@neutron> <4ECAA9FE.6080802@gmx.de> <1321905599.1990.23.camel@neutron> <4ECAAF39.8000702@gmx.de> <1321906189.1990.26.camel@neutron> <4ECAB0BC.0@gmx.de> <6462023D-F767-45DE-9AF0-011CC48374CF@mnot.net> <F7E6E395-463D-4D0C-A352-EAD4B5A27202@tzi.org> <4ECB9E69.8090505@gmx.de> <CABkgnnXk7K2ZGS-1-rjm8zeCUbyUM3PbmkNzt4wjM4CPGXFkPg@mail.gmail.com> <4ECCB8FA.20804@gmx.de> <1322071926.6133.20.camel@neutron> <BDF22250-C431-4F8F-9993-3055B61B0594@tzi.org> <CABkgnnUqqO=FBKWpHJFzjSGCnmTFVyu45Qff43Z=kLh1cz=AFQ@mail.gmail.com> <4ECDF582.1070703@it.aoyama.ac.jp>
Content-Type: multipart/alternative; boundary="=-B5Do/lMCIJX5bYKIEjCb"
X-Mailer: Evolution 3.0.3-2
Mime-Version: 1.0
Subject: Re: [apps-discuss] draft-pbryan-zyp-json-pointer: name syntax for non-ASCII
X-BeenThere: apps-discuss@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: General discussion of application-layer protocols <apps-discuss.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/apps-discuss>
List-Post: <mailto:apps-discuss@ietf.org>
List-Help: <mailto:apps-discuss-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 24 Nov 2011 17:18:57 -0000

I don't think this will work because every JSON parser I've used so far
processes "\/" as solidus "/". By the time it's parsed, there is no
escaping left. Or did I misinterpret, and in actual fact the backslash
would be doubled in actual JSON expression (e.g. "/Bjørn\\/Carsten\\/foo
bar")? That could work. 

Paul

On Thu, 2011-11-24 at 16:42 +0900, "Martin J. Dürst" wrote:

> On 2011/11/24 10:59, Martin Thomson wrote:
> > On 24 November 2011 08:37, Carsten Bormann<cabo@tzi.org>  wrote:
> >> As usual, the guiding principle is that easy things should be easy, and that hard things should be possible.
> >> Complicating the usual case (the only one that many people seem to have thought about yet) is indeed a big no-no.
> >>
> >> Grüße, Carsten
> >
> > A reasonable suggestion.  Maybe just drop the quotes and force an
> > escape for / instead of ":
> >
> >    /Bjørn\/Carsten\/foo \uD834\uDD1E
> 
> For the moment, cutting off the surrogate pair at the end, and adding 
> something to keep the space visible:
> 
>      /Bjørn\/Carsten\/foo bar
> 
> 
> Yes indeed. So when defining json pointers, use '\/' to escape a '/' 
> (and use '\\' to escape '\') that's part of a string rather than a 
> hierarchy delimiter:
> 
>      /Bjørn\/Carsten\/foo bar
> 
> Then when using that as a fragment identifier, you have to escape the 
> '\' (not allowed in URIs/IRIs), and of course the space, but not the '/':
> 
>      #/Bjørn%5C/Carsten%5C/foo%20bar
> 
> Now I really have no clue why surrogate pairs have to be escaped. Why 
> not just use the character? This one didn't show in my mailer or 
> browser, but one would assume that mostly the ones that actually show, 
> at least in some places, will get used. So the actual pointer would be:
> 
>      /Bjørn\/Carsten\/foo 𝄞
> 
> In a fragment (IRI), that would look like:
> 
>      #/Bjørn%5C/Carsten%5C/foo%20𝄞
> 
> If an URI fragment is needed, use UTF-8 and %-encoding:
> 
>      #/Bj%C3%B8rn%5C/Carsten%5C/foo%20%F0%9D%84%9E
> 
> Regards,    Martin.
> _______________________________________________
> apps-discuss mailing list
> apps-discuss@ietf.org
> https://www.ietf.org/mailman/listinfo/apps-discuss