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

From: Peter Saint-Andre - Filament <[email-masked]>
Date: Tue, 1 Aug 2017 10:01:09 -0600

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

---

From: Pete Cordell <[email-masked]>
Date: Tue, 1 Aug 2017 17:28:40 +0100

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

I had been thinking that too.  I do like the direction of focussing the 
requirement on open systems communication though (not to be confused 
with systems built on open software!).  I think the following is pretty 
simple and side-steps issues about what is a network protocol, payload, 
serialization etc.:

8.1.  Character Encoding

    JSON text exchanged between systems that are not part of a closed
    ecosystem MUST be encoded using UTF-8.

Pete Cordell
Codalogic Ltd
C++ tools for C++ programmers, http://codalogic.com
Read & write XML in C++, http://www.xml2cpp.com

---

From: "Matthew A. Miller" <[email-masked]>
Date: Mon, 14 Aug 2017 10:40:55 -0600

>    the presence of a byte order mark rather than treating it as an

Hello JSONbis Working Group,

does anyone have comments on Pete Cordell's suggested text?

- m&m

Matthew A. Miller
< http://goo.gl/LM55L >

---

From: "Paul Hoffman" <[email-masked]>
Date: Mon, 14 Aug 2017 09:50:31 -0700

> does anyone have comments on Pete Cordell's suggested text?

The current wording works for me, and so does Pete's.

--Paul

---

From: Peter Saint-Andre - Filament <[email-masked]>
Date: Mon, 14 Aug 2017 10:56:18 -0600

> The current wording works for me, and so does Pete's.

What Pete suggested seems good enough.

Peter

---

From: "Matthew A. Miller" <[email-masked]>
Date: Tue, 15 Aug 2017 21:01:58 -0600

Thanks you all.  We can take Pete Cordell's suggestions, with the
reference corrected from [UNICODE] to [RFC3629]:

"""
8.1.  Character Encoding

JSON text exchanged between systems that are not part of a closed
ecosystem MUST be encoded using UTF-8 [RFC3629].

"""

Unless there are strong objections, this is the text we'll submit to the
editor.

- m&m

Matthew A. Miller

---

From: Pete Cordell <[email-masked]>
Date: Wed, 23 Aug 2017 12:09:27 +0100

Thanks Matt and all for your patience on this issue and going the extra 
mile (or 2 or 3).  Hopefully it'll save some confusion for readers in 
the future.

Cheers,

Pete.

On 16/08/2017 04:01, Matthew A. Miller wrote:
> _______________________________________________
> json mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/json
>