Re: [Json] First two characters

"Pete Cordell" <petejson@codalogic.com> Sat, 23 November 2013 09:51 UTC

Return-Path: <petejson@codalogic.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 53B0B1AE27B for <json@ietfa.amsl.com>; Sat, 23 Nov 2013 01:51:47 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 3.537
X-Spam-Level: ***
X-Spam-Status: No, score=3.537 tagged_above=-999 required=5 tests=[BAYES_50=0.8, FH_HOST_EQ_D_D_D_D=0.765, HELO_MISMATCH_COM=0.553, RDNS_DYNAMIC=0.982, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, STOX_REPLY_TYPE=0.439] autolearn=no
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 AiJ-Sb1ZgGsg for <json@ietfa.amsl.com>; Sat, 23 Nov 2013 01:51:45 -0800 (PST)
Received: from ppsa-online.com (lvps217-199-162-192.vps.webfusion.co.uk [217.199.162.192]) by ietfa.amsl.com (Postfix) with ESMTP id C08CE1AE26B for <json@ietf.org>; Sat, 23 Nov 2013 01:51:44 -0800 (PST)
Received: (qmail 31717 invoked from network); 23 Nov 2013 09:51:18 +0000
Received: from host86-167-12-24.range86-167.btcentralplus.com (HELO codalogic) (86.167.12.24) by lvps217-199-162-217.vps.webfusion.co.uk with ESMTPSA (RC4-MD5 encrypted, authenticated); 23 Nov 2013 09:51:18 +0000
Message-ID: <7AE46E6FE04C46B1BB9420C20CDB4EC5@codalogic>
From: Pete Cordell <petejson@codalogic.com>
To: Nico Williams <nico@cryptonector.com>, Bjoern Hoehrmann <derhoermi@gmx.net>
References: <v8av89128j49csd5bb5ba2rqrgschs4c79@hive.bjoern.hoehrmann.de> <20131122221940.GD3655@localhost>
Date: Sat, 23 Nov 2013 09:21:18 -0000
X-Unsent: 1
MIME-Version: 1.0
Content-Type: text/plain; format="flowed"; charset="iso-8859-1"; reply-type="original"
x-vipre-scanned: 0022DC51005C560022DD9E
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.5931
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157
Cc: json@ietf.org
Subject: Re: [Json] First two characters
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.15
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: Sat, 23 Nov 2013 09:51:47 -0000

----- Original Message From: "Nico Williams"
> On Fri, Nov 22, 2013 at 07:59:36PM +0100, Bjoern Hoehrmann wrote:
>>   Now that string literals can occur at the top level, the statement in
>> 8.1 http://tools.ietf.org/html/draft-ietf-json-rfc4627bis-07 "the first
>> two characters of a JSON text will always be ASCII characters" is
>> incorrect and needs to be changed alongside changing the JSON-text
>> grammar.
>
>...
>   xx XX        UTF-8    (XX > 0)
>   xx 00 ZZ ZZ  UTF-16LE (ZZ can be any value, but both ZZs can't be 0)
>   00 xx        UTF-16BE
>   00 00 00 xx  UTF-32BE
>   xx 00 00 00  UTF-32LE

I don't see why that offers any benefit over the following table presented 
earlier:

       xx xx -- --  UTF-8
       xx 00 xx --  UTF-16LE
       xx 00 00 xx  UTF-16LE
       xx 00 00 00  UTF-32LE
       00 xx -- --  UTF-16BE
       00 00 -- --  UTF-32BE

What it does demonstrate is that if we are not restricting JSON to UTF-8 and 
only UTF-8 then a table of some description would be very useful in the 
interests of interoperability.

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