Re: [Json] Encoding detection

Paul Hoffman <paul.hoffman@vpnc.org> Sun, 17 November 2013 16:36 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 AD94411E8E73 for <json@ietfa.amsl.com>; Sun, 17 Nov 2013 08:36:16 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -102.599
X-Spam-Level:
X-Spam-Status: No, score=-102.599 tagged_above=-999 required=5 tests=[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 RLWZPaYeXOmk for <json@ietfa.amsl.com>; Sun, 17 Nov 2013 08:36:13 -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 0A1CD11E8DD0 for <json@ietf.org>; Sun, 17 Nov 2013 08:34:30 -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 rAHGYNhZ071479 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sun, 17 Nov 2013 09:34:25 -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]
Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1822\))
Content-Type: text/plain; charset="us-ascii"
From: Paul Hoffman <paul.hoffman@vpnc.org>
X-Priority: 3
In-Reply-To: <75E35201E30C4EA4B143B520CB6DF273@codalogic>
Date: Sun, 17 Nov 2013 08:34:24 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <13A5A836-A670-4412-82F8-B7BBE84A2FC8@vpnc.org>
References: <CEAA3067.2D132%jhildebr@cisco.com> <f5bbo1mzyvw.fsf@troutbeck.inf.ed.ac.uk> <75E35201E30C4EA4B143B520CB6DF273@codalogic>
To: Pete Cordell <petejson@codalogic.com>
X-Mailer: Apple Mail (2.1822)
Cc: 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 16:36:32 -0000

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.

--Paul Hoffman