Re: [Json] Unpaired surrogates in JSON strings

Tim Bray <tbray@textuality.com> Thu, 06 June 2013 00:31 UTC

Return-Path: <tbray@textuality.com>
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 42A9621F86AE for <json@ietfa.amsl.com>; Wed, 5 Jun 2013 17:31:42 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.377
X-Spam-Level:
X-Spam-Status: No, score=-0.377 tagged_above=-999 required=5 tests=[FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-1]
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 TZ4KlaukiRSW for <json@ietfa.amsl.com>; Wed, 5 Jun 2013 17:31:37 -0700 (PDT)
Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by ietfa.amsl.com (Postfix) with ESMTP id 1C87D21E804E for <json@ietf.org>; Wed, 5 Jun 2013 17:19:26 -0700 (PDT)
Received: by mail-vc0-f174.google.com with SMTP id kw10so1556387vcb.19 for <json@ietf.org>; Wed, 05 Jun 2013 17:18:50 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:cc:content-type:x-gm-message-state; bh=+4h3Mtr/Qdkd2tKEXjUUSz50MNxDumKWbt+KeR+wFaI=; b=GAf8BHnlmK8AcK0EvvFJ9FKHXaoj/8cV8kKvzGi8p/3Li8tD76lxDOuShj0J6T4cPR meBvcHD/rdom68+D4btUR2b0pHs0VXVnZrBiev3od0g8UtcSMLKNIIzWt2egh1Usa50o 4Nzij/TqxEtT83re1GX4eD4E1sgcQoCZym91MeOpawiEuOxt3D5zlg2+WEBu/uSn3wja o4fQIKJhobSstZL3Uq8Gut5NS+30xD7fwf0HgSi1KvVQObq2mVCbPotZ7C/3+LDnPBg3 LSVGvIRqLzvpYWTtBaVDD4WAD2aTNo4wAhoTMVqpsMcL/s1lzjVio5rgy2GuGBTayttu naxA==
MIME-Version: 1.0
X-Received: by 10.52.237.228 with SMTP id vf4mr965887vdc.79.1370477930531; Wed, 05 Jun 2013 17:18:50 -0700 (PDT)
Received: by 10.220.48.14 with HTTP; Wed, 5 Jun 2013 17:18:50 -0700 (PDT)
X-Originating-IP: [96.49.81.176]
In-Reply-To: <AE081E5F-82AB-416F-A690-E8373C0369B0@vpnc.org>
References: <20130605162246.GG3680@mercury.ccil.org> <51AF7988.6040009@crockford.com> <20130605184702.GB6999@mercury.ccil.org> <51AF8A09.50806@crockford.com> <AE081E5F-82AB-416F-A690-E8373C0369B0@vpnc.org>
Date: Wed, 05 Jun 2013 17:18:50 -0700
Message-ID: <CAHBU6is9NBuicPm=mNSTLRUvXjrAt8BA5KH=A4pSeCNJy=vTNQ@mail.gmail.com>
From: Tim Bray <tbray@textuality.com>
To: Paul Hoffman <paul.hoffman@vpnc.org>
Content-Type: multipart/alternative; boundary="089e0122f6aa38f7d104de7142b8"
X-Gm-Message-State: ALoCoQkBQ67AN7l1VYzu7p7vSBFnbcrGeTSuy+Z68RWvj6gcVnaQbRSpm3Pwjiu0YODyRndfSpVd
Cc: Douglas Crockford <douglas@crockford.com>, "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] Unpaired surrogates in JSON strings
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: Thu, 06 Jun 2013 00:31:42 -0000

In section 2.5 of 4627, a reasonable reading of the text clearly disallows
unpaired surrogates, because the discussion is exclusively of characters,
which surrogates aren’t; they are code points, but there are no characters
that have those code points. From the introduction: “A string is a sequence
of zero or more Unicode characters”. Case closed.

A loose reading of the BNF probably allows naked surrogates if you ignore
what the text says.

I think anyone who’s delivering those codepoints is already in violation of
4627, and I don’t think we should retroactively forgive those sins.

-T


On Wed, Jun 5, 2013 at 4:55 PM, Paul Hoffman <paul.hoffman@vpnc.org> wrote:

> On Jun 5, 2013, at 11:57 AM, Douglas Crockford <douglas@crockford.com>
> wrote:
>
> > On 6/5/2013 11:47 AM, John Cowan wrote:
> >> Douglas Crockford scripsit:
> >>
> >>> Such a requirement will be breaking. Breaking changes are out of scope.
> >> How is it a breaking change to limit what documents are allowed to be
> >> *generated*?
> >>
> > Because JSON is currently being used in applications that deliver those
> codepoints.
>
> Can you say why an application would do that, given the JSON specification?
>
> --Paul Hoffman
>
> _______________________________________________
> json mailing list
> json@ietf.org
> https://www.ietf.org/mailman/listinfo/json
>