Re: [Json] JSON: remove gap between Ecma-404 and IETF draft

Paul Hoffman <paul.hoffman@vpnc.org> Wed, 13 November 2013 21:28 UTC

Return-Path: <paul.hoffman@vpnc.org>
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 38C5821E8104; Wed, 13 Nov 2013 13:28:16 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -102.592
X-Spam-Level:
X-Spam-Status: No, score=-102.592 tagged_above=-999 required=5 tests=[AWL=0.007, BAYES_00=-2.599, 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 r6V7tRiikVGE; Wed, 13 Nov 2013 13:28:15 -0800 (PST)
Received: from hoffman.proper.com (IPv6.Hoffman.Proper.COM [IPv6:2605:8e00:100:41::81]) by ietfa.amsl.com (Postfix) with ESMTP id 4E4FD21E8121; Wed, 13 Nov 2013 13:28:06 -0800 (PST)
Received: from [10.20.30.90] (50-0-66-41.dsl.dynamic.sonic.net [50.0.66.41]) (authenticated bits=0) by hoffman.proper.com (8.14.7/8.14.7) with ESMTP id rADLRxMj088941 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 13 Nov 2013 14:28:00 -0700 (MST) (envelope-from paul.hoffman@vpnc.org)
X-Authentication-Warning: hoffman.proper.com: Host 50-0-66-41.dsl.dynamic.sonic.net [50.0.66.41] claimed to be [10.20.30.90]
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1822\))
From: Paul Hoffman <paul.hoffman@vpnc.org>
In-Reply-To: <CEA92854.2CC53%jhildebr@cisco.com>
Date: Wed, 13 Nov 2013 13:27:58 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <3389CD77-B1CC-4A76-907A-6D400DA028CC@vpnc.org>
References: <CEA92854.2CC53%jhildebr@cisco.com>
To: Joe Hildebrand Hildebrand <jhildebr@cisco.com>
X-Mailer: Apple Mail (2.1822)
Cc: Anne van Kesteren <annevk@annevk.nl>, JSON WG <json@ietf.org>, IETF Discussion <ietf@ietf.org>, "www-tag@w3.org" <www-tag@w3.org>, es-discuss <es-discuss@mozilla.org>
Subject: Re: [Json] JSON: remove gap between Ecma-404 and IETF draft
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.12
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: <http://www.ietf.org/mail-archive/web/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: Wed, 13 Nov 2013 21:28:17 -0000

<no hat>

On Nov 13, 2013, at 12:24 PM, Joe Hildebrand (jhildebr) <jhildebr@cisco.com> wrote:

> We would also need to change section 8.1 according to the mechanism that
> was previously proposed:
> 
> 00 00 00 xx  UTF-32BE
>    00 xx ?? xx  UTF-16BE
>    xx 00 00 00  UTF-32LE
>    xx 00 xx ?? UTF-16LE
>    xx xx ?? ?? UTF-8
> 
> in order to account for strings at the top level whose first character has
> a codepoint greater than 127.

A string at the top level of a JSON text still needs to start with an ASCII " character, so the logic is still fine, I believe.

Carsten's point about whitespace is more problematic. Does the ECMA-404 definition of a JSON text allow it to start with one (or more) whitespace characters? The text in that document says:
. . .
A JSON text is a sequence of tokens formed from Unicode code points that conforms to the JSON value grammar. The set of tokens includes six structural tokens, strings, numbers, and three literal name tokens.
. . .
Insignificant whitespace is allowed before or after any token.
. . .

It would be nice if ECMA-404 was clearer on this, given that the racetrack illustrations show everything other than the whitespace. In specific, it would be good to know whether or not the racetrack for "value" in Section 5 is meant to have optional whitespace at the left and right to match the above text. If TC39 could say for certain on that, it would be useful to the community.

--Paul Hoffman