Re: [Json] Scope: Wire format or runtime format?

Jorge <jorge@jorgechamorro.com> Tue, 18 June 2013 14:10 UTC

Return-Path: <jorge@jorgechamorro.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 C550F21F9F4B for <json@ietfa.amsl.com>; Tue, 18 Jun 2013 07:10:35 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.303
X-Spam-Level:
X-Spam-Status: No, score=-0.303 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, J_CHICKENPOX_45=0.6, MIME_8BIT_HEADER=0.3, WEIRD_QUOTING=1.396]
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 abMth2czlxbD for <json@ietfa.amsl.com>; Tue, 18 Jun 2013 07:10:35 -0700 (PDT)
Received: from mail-wi0-x232.google.com (mail-wi0-x232.google.com [IPv6:2a00:1450:400c:c05::232]) by ietfa.amsl.com (Postfix) with ESMTP id BDC6821E8054 for <json@ietf.org>; Tue, 18 Jun 2013 07:10:32 -0700 (PDT)
Received: by mail-wi0-f178.google.com with SMTP id k10so3274352wiv.5 for <json@ietf.org>; Tue, 18 Jun 2013 07:10:31 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=ZMs4MOAXsHN1fVehwhk7+lGnVhdN9gGi86uh8bgh214=; b=ZJ3asS8niTjQ1qds/BOqakuTV1kIB37y/wzpRPhRSK1BfDV8c55OFVcb414cTnvgz+ Lr4/g+5cFmCWPC6bZXH+UBqgehNnmb6I0yzcBc958m0TTQ6/X4P80OxfOFaII6PlJMLt S/btgYav9db6voUvXGdn0IR0AevE+VsMK4Ew65b+enzmanm/mqAewiq99Dt5DdllRh5s +AqiUmEzHkgCw0PaqgFEGoDUMJKJTnvCNJwzXY/wHATEOH9wZAlAG2NmJkd02wol5Gs7 9a/XacckEdxyKUS6mB2sJgdvVtOEf37QCMoM+O87zPwBEHHhpZknvKU4KJ/tfB7/4NRR 9nHQ==
X-Received: by 10.180.182.229 with SMTP id eh5mr7782340wic.63.1371564631732; Tue, 18 Jun 2013 07:10:31 -0700 (PDT)
Received: from [192.168.10.50] (31.Red-83-54-170.dynamicIP.rima-tde.net. [83.54.170.31]) by mx.google.com with ESMTPSA id r9sm2375597wik.1.2013.06.18.07.10.30 for <multiple recipients> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Jun 2013 07:10:31 -0700 (PDT)
Mime-Version: 1.0 (Apple Message framework v1085)
Content-Type: text/plain; charset="utf-8"
From: Jorge <jorge@jorgechamorro.com>
In-Reply-To: <51C0353C.3010100@it.aoyama.ac.jp>
Date: Tue, 18 Jun 2013 16:10:28 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <C0A651B1-E21D-4F7F-B2F7-A38772CA173E@jorgechamorro.com>
References: <6FC6B441-B74D-4B9F-B883-065C05890880@lindenbergsoftware.com> <51BE8DEA.7030307@it.aoyama.ac.jp> <118A7923-5D66-4EF5-8A78-CAE125032010@lindenbergsoftware.com> <20130617115453.GC19150@mercury.ccil.org> <51C0353C.3010100@it.aoyama.ac.jp>
To: "Martin J. Dürst" <duerst@it.aoyama.ac.jp>
X-Mailer: Apple Mail (2.1085)
X-Gm-Message-State: ALoCoQlIlJsGVFP731odqXC1iRcf84VvWtJ3q45X7ID8uP3qxdgzp0+jCBhwXFzD1lFDGjy3yit9
Cc: Norbert Lindenberg <ietf@lindenbergsoftware.com>, John Cowan <cowan@mercury.ccil.org>, json@ietf.org
Subject: Re: [Json] Scope: Wire format or runtime format?
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: Tue, 18 Jun 2013 14:10:36 -0000

On 18/06/2013, at 12:23, Martin J. Dürst wrote:
> On 2013/06/17 20:54, John Cowan wrote:
>> Norbert Lindenberg scripsit:
>> 
>>> Maybe you have a better term for it: What I mean in the ECMAScript
>>> context is the format that the functions JSON.parse and JSON.stringify
>>> parse and produce [1].
>> 
>> This simply is the description of JSON at the level of characters.
> 
> Expressed as UTF-16 because that's what ECMAScript uses.

Note what JSON.stringify() produces is a subset of JSON, a subset of what JSON.stringify() accepts:

```javascript

a= '"\\'+'u2603"'
""\u2603""

b= '"\u2603"'
""☃""

JSON.parse(a) === JSON.parse(b)
true

Because JSON.stringify("☃") won't ever give you an ""\u2603"", even though it's as valid JSON as ""☃"", and .parse()s to the same value.
-- 
( Jorge )();