Re: [Json] BOMs

Chris Lilley <chris@w3.org> Tue, 19 November 2013 21:32 UTC

Return-Path: <chris@w3.org>
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 A031C1AE201; Tue, 19 Nov 2013 13:32:08 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.378
X-Spam-Level:
X-Spam-Status: No, score=-6.378 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DATE_IN_PAST_12_24=1.049, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-0.525, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham
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 4sMBATYC1qtV; Tue, 19 Nov 2013 13:32:07 -0800 (PST)
Received: from jay.w3.org (ssh.w3.org [128.30.52.60]) by ietfa.amsl.com (Postfix) with ESMTP id 027C81AE1FA; Tue, 19 Nov 2013 13:32:06 -0800 (PST)
Received: from localhost ([127.0.0.1] helo=M6700) by jay.w3.org with esmtpa (Exim 4.72) (envelope-from <chris@w3.org>) id 1Vistk-0006JQ-2C; Tue, 19 Nov 2013 16:31:52 -0500
Date: Tue, 19 Nov 2013 08:13:37 +0100
From: Chris Lilley <chris@w3.org>
Organization: W3C
X-Priority: 3 (Normal)
Message-ID: <1988085269.20131119081337@w3.org>
To: Bjoern Hoehrmann <derhoermi@gmx.net>
In-Reply-To: <626k89plqltbqd5uqgo15krutbn38qa909@hive.bjoern.hoehrmann.de>
References: <AA45B3C6-1DC5-4B1E-8045-C9FE76022584@vpnc.org> <CEA92854.2CC53%jhildebr@cisco.com> <20131113224737.GI31823@mercury.ccil.org> <f5bob5n71y7.fsf@troutbeck.inf.ed.ac.uk> <5284B095.4070004@it.aoyama.ac.jp> <C37B2FE59C164DBCA982AC81A56A09AA@codalogic> <f5bk3g6ufqy.fsf@troutbeck.inf.ed.ac.uk> <5289F974.9020709@it.aoyama.ac.jp> <2tuj89hcus182t4f4rqqgi1dpabt11qak7@hive.bjoern.hoehrmann.de> <f5b61rpvpax.fsf@troutbeck.inf.ed.ac.uk> <626k89plqltbqd5uqgo15krutbn38qa909@hive.bjoern.hoehrmann.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailman-Approved-At: Tue, 19 Nov 2013 13:37:33 -0800
Cc: "Henry S. Thompson" <ht@inf.ed.ac.uk>, JSON WG <json@ietf.org>, Anne van Kesteren <annevk@annevk.nl>, es-discuss <es-discuss@mozilla.org>, "Martin J. Dürst" <duerst@it.aoyama.ac.jp>, www-tag@w3.org, IETF Discussion <ietf@ietf.org>
Subject: Re: [Json] BOMs
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: Tue, 19 Nov 2013 21:32:08 -0000

Hello Bjoern,

Monday, November 18, 2013, 2:48:19 PM, you wrote:


> In other words, always passing a UTF-8 encoded byte string to the byte
> string parsing part of the JSON implementation.

Yes, a byte stream will contain a BOM if one is present.

> RFC 4627 is the only
> specification for the application/json on-the-wire format and it does
> not mention anything about Unicode signatures. Looking for certain byte
> sequences at the beginning and treating them as a Unicode signature is
> the same as looking for `/* ... */` and treating it as a comment.

No, because /* */ are characters and are found in a character stream.
And a character stream does not contain a BOM as a BOM is not
character data.

RFC 4627 doesn't need to say this, because Unicode says it.

If JSON mixes up characters and bytes there will of course be
confusion. But hopefully it doesn't, as this is not 1990 anymore.



-- 
Best regards,
 Chris                            mailto:chris@w3.org