Re: [Json] I-D Action: draft-ietf-jsonbis-rfc7159bis-04.txt

Peter Saint-Andre - Filament <peter@filament.com> Tue, 01 August 2017 16:01 UTC

Return-Path: <peter@filament.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 9D27812EC1D for <json@ietfa.amsl.com>; Tue, 1 Aug 2017 09:01:15 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.601
X-Spam-Level:
X-Spam-Status: No, score=-2.601 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=filament-com.20150623.gappssmtp.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gNnrWwkUd8WQ for <json@ietfa.amsl.com>; Tue, 1 Aug 2017 09:01:14 -0700 (PDT)
Received: from mail-it0-x22e.google.com (mail-it0-x22e.google.com [IPv6:2607:f8b0:4001:c0b::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id DDB1D12EAE8 for <json@ietf.org>; Tue, 1 Aug 2017 09:01:12 -0700 (PDT)
Received: by mail-it0-x22e.google.com with SMTP id 77so10175392itj.1 for <json@ietf.org>; Tue, 01 Aug 2017 09:01:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=filament-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=Mn1UWxZy2TyLc3YyPa6iRuC4bWfB4dtIne8Uz7WcLNM=; b=tIXUsoMldzLuj1F5jTjlOg+jvdHazl1NXv8E8WoRLFXhcon3QhQ5x7aKIcrXC4RBza O6rGP7nnZl96ltUDxdVRXUzudbBJ1SRYV/BsDNJaW+FVkCvFlGUaDWGhH7JVdxm7rl6M SeN6INpOTWEAUlO8P6w5gBRXZjND/PZQ5uQFumAHOgJDnFEXgrWpkmDnA6ZUsV9AgbYY lf0wvtCFQTcOlY4XfuE650KxiZ7YNJupFjQhSuWNPq9qm1ByuV5nn/ahm7EbLmM3139P bpsjCpju+fUjH4PpdiXWLW2+G/HkjieLIrgpEHzoeoqIHMfZu/HiU0CqWkZDyNA+21OV JXwA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=Mn1UWxZy2TyLc3YyPa6iRuC4bWfB4dtIne8Uz7WcLNM=; b=p+R+pVEOPhgLMqZiLRMmRVXcINk9XV2EY44rPA51qL0d3TsCcIs+YDWkQ6XgZyIB05 aCHE48KQIGmseaDWtNPpMoAh7Qc0OE0CjNCbzZaFIbVeQykUHhcU5iZe6vOgfL6nGC79 xe0bV4qIyTxmOGfp4zXshIF91IahnDN5LUT6DUJTDDy7oypLMiR29FLMkmnC6JWNId/A rRSSv+nFIEu6hZu2H9uYDzd488kAJ/HqW2tPicqGvXyT3AKGqL3WrO/gMfyl7S3gACd+ /FDDbaYGmHhJkrffyPBhzdSCQJ3zk8H0+CnrKsI908XxpDs+RD4/9oX0DSevi92VcfGw gv6A==
X-Gm-Message-State: AIVw111oitPVEGi5uqtZ9ebw3Q/f1vmOYArOscM9waLmOVcLAboianNC e+QNvhWnT54GCXac
X-Received: by 10.36.135.202 with SMTP id f193mr2369252ite.48.1501603272021; Tue, 01 Aug 2017 09:01:12 -0700 (PDT)
Received: from aither.local ([2601:282:4202:67d3:698a:246b:b568:1b8d]) by smtp.gmail.com with ESMTPSA id f202sm14602951iof.69.2017.08.01.09.01.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Aug 2017 09:01:11 -0700 (PDT)
To: Pete Cordell <petejson@codalogic.com>, Anders Rundgren <anders.rundgren.net@gmail.com>
References: <150047191184.7507.7143481683564082881@ietfa.amsl.com> <DB9BA7EA-D393-4079-B347-620A09280B26@isode.com> <CAC4RtVBYMrRCrUZ1qqD+_rH4M8N23GOgbbh=921fEYqH+gCm5Q@mail.gmail.com> <c06e583a-965e-9eaf-975f-e6876ac056ed@filament.com> <f1a6b553-c787-e248-67bd-74d68d98a845@gmx.de> <262E8314-263A-4443-B912-AFCF1A3277B2@tzi.org> <166957c4-26fc-90b5-a798-59280c91b466@filament.com> <8B60039F-96DD-4F72-8139-D80B6F11566C@tzi.org> <3760a157-5b88-e334-712c-03eecd675794@codalogic.com> <7a88952c-3e46-3f87-b3c2-2864f216c62d@gmail.com> <9cddf2e7-f987-3942-3580-05c3da6a4805@codalogic.com>
Cc: Julian Reschke <julian.reschke@gmx.de>, json@ietf.org
From: Peter Saint-Andre - Filament <peter@filament.com>
Message-ID: <2892a0eb-0bd2-cd2e-87e7-aa2e29009b4b@filament.com>
Date: Tue, 1 Aug 2017 10:01:09 -0600
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <9cddf2e7-f987-3942-3580-05c3da6a4805@codalogic.com>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 8bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/DXpBQEfU3-lPchbx4hagYmAePSs>
Subject: Re: [Json] I-D Action: draft-ietf-jsonbis-rfc7159bis-04.txt
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/json/>
List-Post: <mailto:json@ietf.org>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json>, <mailto:json-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 01 Aug 2017 16:01:16 -0000

On 7/24/17 9:12 AM, Pete Cordell wrote:
> On 22/07/2017 08:51, Anders Rundgren wrote:
>> I don't have any text to offer but I believe that UFT-8 encoding is the
>> only recommendable way for transferring JSON data from one system to
>> another which includes lots of other use case than HTTP.  For example:
>> Writing JSON to databases, usage in WebSocket messages, or simply putting
>> JSON in file.
>>
>> Yes, it seems to me that "Serialized format"/"External representation" is
>> really the common denominator rather than networks and/or protocols.
> 
> And:
> 
> On 22/07/2017 10:18, Anders Rundgren wrote:
>> I would consider "external form" as an alternative to limiting the
>> specification
>> to special cases like networks and or protocols.
> 
> And:
> 
> On 22/07/2017 08:53, Julian Reschke wrote:
>> Whatever we say, it should make clear that it includes all derived
>> media types (*/*+json) as well.
> 
> Thanks Anders and Julian.
> 
> Makes me wonder whether the best approach is to start with what is
> currently the second paragraph of 8.1 as a 'softener', and then hit the
> reader with UTF-8 being the only real way to go for interoperability of
> open systems. 

We're not writing a novel here. :-)

> So maybe 8.1 becomes something like:
> 
> 8.1.  Character Encoding
> 
>    Previous specifications of JSON have not required the use of UTF-8
>    when transmitting JSON text.  However, the vast majority of JSON-
>    based software implementations have chosen to use the UTF-8 encoding,
>    to the extent that it is the only encoding that achieves
>    interoperability.
> 
>    Therefore, JSON text exchanged between systems that don't form a
>    closed ecosystem MUST be encoded using UTF-8.
> 
>    Implementations MUST NOT add a byte order mark (U+FEFF) to the
>    beginning of a networked-transmitted JSON text.  In the interests of
>    interoperability, implementations that parse JSON texts MAY ignore
>    the presence of a byte order mark rather than treating it as an
>    error.

I feel like we're over-complicating things. I had proposed:

   When an entity transmits JSON text over a network, e.g. as the
   payload of an application protocol, it MUST encode that text using
   UTF-8 [RFC3629].

Carsten said that looked fine to him. Julian suggested that we mention
the application/json media type and types derived from it. Anders
suggested that we specify this in terms of serialized formats between
systems (even storage in a file) rather than networks or protocols.

Taking that feedback into account, I suggest:

   When an entity represents JSON text in a serialized format (e.g., as
   the payload of an application protocol using the application/json
   media type or a type derived therefrom), it MUST encode that text
   using UTF-8 [RFC3629].

Peter