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

"Martin J. Dürst" <duerst@it.aoyama.ac.jp> Tue, 22 November 2011 09:09 UTC

Return-Path: <duerst@it.aoyama.ac.jp>
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 D68D921F8C7F for <apps-discuss@ietfa.amsl.com>; Tue, 22 Nov 2011 01:09:16 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -99.643
X-Spam-Level:
X-Spam-Status: No, score=-99.643 tagged_above=-999 required=5 tests=[AWL=0.147, BAYES_00=-2.599, HELO_EQ_JP=1.244, HOST_EQ_JP=1.265, MIME_8BIT_HEADER=0.3, 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 pj6og2vj2+F7 for <apps-discuss@ietfa.amsl.com>; Tue, 22 Nov 2011 01:09:16 -0800 (PST)
Received: from scintmta02.scbb.aoyama.ac.jp (scintmta02.scbb.aoyama.ac.jp [133.2.253.34]) by ietfa.amsl.com (Postfix) with ESMTP id DECA421F8C7E for <apps-discuss@ietf.org>; Tue, 22 Nov 2011 01:09:15 -0800 (PST)
Received: from scmse02.scbb.aoyama.ac.jp ([133.2.253.231]) by scintmta02.scbb.aoyama.ac.jp (secret/secret) with SMTP id pAM996fg027262 for <apps-discuss@ietf.org>; Tue, 22 Nov 2011 18:09:06 +0900
Received: from (unknown [133.2.206.133]) by scmse02.scbb.aoyama.ac.jp with smtp id 305b_2de0_a11eea4c_14e9_11e1_85ad_001d096c5782; Tue, 22 Nov 2011 18:09:06 +0900
Received: from [IPv6:::1] ([133.2.210.1]:35374) by itmail.it.aoyama.ac.jp with [XMail 1.22 ESMTP Server] id <S1570B0B> for <apps-discuss@ietf.org> from <duerst@it.aoyama.ac.jp>; Tue, 22 Nov 2011 18:09:10 +0900
Message-ID: <4ECB66B0.6060102@it.aoyama.ac.jp>
Date: Tue, 22 Nov 2011 18:09:04 +0900
From: =?UTF-8?B?Ik1hcnRpbiBKLiBEw7xyc3Qi?= <duerst@it.aoyama.ac.jp>
Organization: Aoyama Gakuin University
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.9) Gecko/20100722 Eudora/3.0.4
MIME-Version: 1.0
To: Mark Nottingham <mnot@mnot.net>
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> <1321912269.1990.32.camel@neutron> <E880E90A-332F-4D2F-9B20-7B7ADD03FE27@mnot.net>
In-Reply-To: <E880E90A-332F-4D2F-9B20-7B7ADD03FE27@mnot.net>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: IETF Apps Discuss <apps-discuss@ietf.org>
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: Tue, 22 Nov 2011 09:09:17 -0000

On 2011/11/22 8:43, Mark Nottingham wrote:
> The usual approach to this sort of thing is to define the "canonical" way to do it; i.e., json pointers *are* unicode strings; then you can define encodings into various environments (like URIs).
>
> In this case, it'd probably be good enough to say that json pointers are unicode strings,

Up to here, this makes a ton of sense.

> but that when they need to be in ASCII environments (like URIs) they get UTF-8'ed and then percent-escaped.

This would mean that e.g. in a Java program that for some reason is kept 
in US-ASCII, I'd have to use %-encoding. This doesn't make sense to me 
at all.

So I'd say that json pointers are escaped according to the conventions 
of the substrate that carries them when needed (e.g. pure ASCII, or 
other kinds of encodings that can't handle the whole Unicode range).

Then for json pointers as fragment identifiers, I'd mention that where 
necessary (e.g. for URIs), the convention for converting from IRIs to 
URIs (see RFC 3987) applies.

By the way, I don't see a need to escape "/" at all in a fragment 
identifier. "/" is plain and simply allowed in fragment identifiers. 
Please see http://tools.ietf.org/html/rfc3986#section-3.5. Of course, 
it's not forbidden to escape "/", so software that is interpreting a 
fragment identifier has to make sure it does the right thing.

Regards,    Martin.


> Cheers,
>
>
> On 22/11/2011, at 8:51 AM, Paul C. Bryan wrote:
>
>> Okay, so I'll write-up separate sections for JSON string values and URI fragment identifiers. Any objections?
>>
>> Paul
>>
>> On Tue, 2011-11-22 at 07:55 +1100, Mark Nottingham wrote:
>>> +1 to Julian here -- there's no reason why non-ASCII chars need to be percent-encoded when they occur inside a JSON document, only when they're in a URI (or similar context).
>>>
>>> Cheers,
>>>
>>>
>>> On 22/11/2011, at 7:12 AM, Julian Reschke wrote:
>>>
>>>> On 2011-11-21 21:09, Paul C. Bryan wrote:
>>>>> The intent is to allow a JSON Pointer to be expressed as a JSON string
>>>>> value as well as a URI fragment identifier. The latter is the most
>>>>> significant driver for URI percent-encoding.
>>>>> ...
>>>>
>>>> Well, you could use it as fragment identifier (or otherwise URI component) by UTF-8-percent-escaping.
>>>>
>>>> The question is whether that use case requires them to be all ASCII every else, such as in a JSON patch document.
>>>>
>>>> Best regards, Julian
>>>> _______________________________________________
>>>> apps-discuss mailing list
>>>>
>>> apps-discuss@ietf.org
>>>
>>>>
>>> https://www.ietf.org/mailman/listinfo/apps-discuss
>>>
>>>
>>> --
>>> Mark Nottingham
>>> http://www.mnot.net/
>>>
>>>
>>>
>>>
>>>
>>
>> _______________________________________________
>> apps-discuss mailing list
>> apps-discuss@ietf.org
>> https://www.ietf.org/mailman/listinfo/apps-discuss
>
> --
> Mark Nottingham   http://www.mnot.net/
>
>
>
> _______________________________________________
> apps-discuss mailing list
> apps-discuss@ietf.org
> https://www.ietf.org/mailman/listinfo/apps-discuss
>