Re: [Json] Encoding detection

Bjoern Hoehrmann <derhoermi@gmx.net> Sun, 17 November 2013 20:01 UTC

Return-Path: <derhoermi@gmx.net>
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 6E2D511E91C5 for <json@ietfa.amsl.com>; Sun, 17 Nov 2013 12:01:50 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.599
X-Spam-Level:
X-Spam-Status: No, score=-6.599 tagged_above=-999 required=5 tests=[AWL=-4.000, BAYES_00=-2.599]
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 icqpMjNMXFxV for <json@ietfa.amsl.com>; Sun, 17 Nov 2013 12:01:32 -0800 (PST)
Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by ietfa.amsl.com (Postfix) with ESMTP id 3C6DA11E921A for <json@ietf.org>; Sun, 17 Nov 2013 12:00:52 -0800 (PST)
Received: from netb.Speedport_W_700V ([91.35.23.147]) by mail.gmx.com (mrgmx101) with ESMTPA (Nemesis) id 0Ldttv-1VI7Uo3zz1-00j2Zc for <json@ietf.org>; Sun, 17 Nov 2013 21:00:51 +0100
From: Bjoern Hoehrmann <derhoermi@gmx.net>
To: Paul Hoffman <paul.hoffman@vpnc.org>
Date: Sun, 17 Nov 2013 21:00:48 +0100
Message-ID: <3r7i899fler32pdhu1p2nhof0ohl9g8ufp@hive.bjoern.hoehrmann.de>
References: <CEAA3067.2D132%jhildebr@cisco.com> <f5bbo1mzyvw.fsf@troutbeck.inf.ed.ac.uk> <75E35201E30C4EA4B143B520CB6DF273@codalogic> <13A5A836-A670-4412-82F8-B7BBE84A2FC8@vpnc.org>
In-Reply-To: <13A5A836-A670-4412-82F8-B7BBE84A2FC8@vpnc.org>
X-Mailer: Forte Agent 3.3/32.846
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Provags-ID: V03:K0:CDgxxPZcrb8spSwY/zAxKV4mwmAUADt1BIkaFYBI1D5oCamRO6u U3z/fRW+30a+NiOsPTw723QGcww46AkduFbwTSwGy3VSK0bKleSKlvlFpmLuOS+xGMH/pVU xgRzmvVRWMt6jWc7i7ABa9HE+/6c7rQJrMTs1qmg2Vz6cB57czqJ6w+wQazhjcOpXPohzOR ZZl1HfnaELWvOE0krB7iA==
Cc: Pete Cordell <petejson@codalogic.com>, JSON WG <json@ietf.org>
Subject: Re: [Json] Encoding detection
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: Sun, 17 Nov 2013 20:01:51 -0000

* Paul Hoffman wrote:
>On Nov 17, 2013, at 2:02 AM, Pete Cordell <petejson@codalogic.com> wrote:
>
>> While I'm here, Joe mentioned "implementable".  From an implementer's
>> perspective the table I presented earlier might be better presented in the
>> following order:
>> 
>>  00 00 -- --  UTF-32BE
>>  00 xx -- --  UTF-16BE
>>  xx xx -- --  UTF-8
>>  xx 00 xx --  UTF-16LE
>>  xx 00 00 xx  UTF-16LE
>>  xx 00 00 00  UTF-32LE
>> 
>> Or is that taking the fun out of it for the implementer?!
>
>I'm not sure that is the right order. Wouldn't that make UTF-16LE be 
>mistaken for UTF-8? It seems to me that the UTF-8 rule has to be last 
>because it is more general than any of the ones above it.

No, `xx` stands for a non-zero byte.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/