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

Peter Saint-Andre - Filament <> Tue, 01 August 2017 16:01 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 9D27812EC1D for <>; Tue, 1 Aug 2017 09:01:15 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.601
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: (amavisd-new); dkim=pass (2048-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id gNnrWwkUd8WQ for <>; Tue, 1 Aug 2017 09:01:14 -0700 (PDT)
Received: from ( [IPv6:2607:f8b0:4001:c0b::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id DDB1D12EAE8 for <>; Tue, 1 Aug 2017 09:01:12 -0700 (PDT)
Received: by with SMTP id 77so10175392itj.1 for <>; Tue, 01 Aug 2017 09:01:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; 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;; 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 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 with ESMTPSA id f202sm14602951iof.69.2017. (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Aug 2017 09:01:11 -0700 (PDT)
To: Pete Cordell <>, Anders Rundgren <>
References: <> <> <> <> <> <> <> <> <> <> <>
Cc: Julian Reschke <>,
From: Peter Saint-Andre - Filament <>
Message-ID: <>
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: <>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 8bit
Archived-At: <>
Subject: Re: [Json] I-D Action: draft-ietf-jsonbis-rfc7159bis-04.txt
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-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].