[Json] Fixing the U+2028 and U+2029 problem

John Cowan <cowan@mercury.ccil.org> Fri, 01 August 2014 21:10 UTC

Return-Path: <cowan@ccil.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 027971A00DE for <json@ietfa.amsl.com>; Fri, 1 Aug 2014 14:10:27 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.098
X-Spam-Level:
X-Spam-Status: No, score=0.098 tagged_above=-999 required=5 tests=[BAYES_50=0.8, RCVD_IN_DNSWL_LOW=-0.7, RP_MATCHES_RCVD=-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 XcmuVAk7fuiO for <json@ietfa.amsl.com>; Fri, 1 Aug 2014 14:10:25 -0700 (PDT)
Received: from earth.ccil.org (earth.ccil.org [192.190.237.11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 003131A008B for <json@ietf.org>; Fri, 1 Aug 2014 14:10:24 -0700 (PDT)
Received: from cowan by earth.ccil.org with local (Exim 4.72) (envelope-from <cowan@ccil.org>) id 1XDK5n-0002rn-Nz for json@ietf.org; Fri, 01 Aug 2014 17:10:23 -0400
Date: Fri, 01 Aug 2014 17:10:23 -0400
From: John Cowan <cowan@mercury.ccil.org>
To: json@ietf.org
Message-ID: <20140801211023.GI13476@mercury.ccil.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
User-Agent: Mutt/1.5.20 (2009-06-14)
Sender: John Cowan <cowan@ccil.org>
Archived-At: http://mailarchive.ietf.org/arch/msg/json/yYj57cI7GFsETUlmCa0jBl9m-vo
Subject: [Json] Fixing the U+2028 and U+2029 problem
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: Fri, 01 Aug 2014 21:10:27 -0000

The unescaped characters U+2028 (LINE SEPARATOR) and U+2029 (PARAGRAPH
SEPARATOR) are valid in JSON strings, but illegal in JavaScript strings.
It's too late to warn about this in RFC 7159, but can we get a requirement
to escape these two characters into the definition of I-JSON, please?
It's a minor gotcha, but still a gotcha.

-- 
John Cowan          http://www.ccil.org/~cowan        cowan@ccil.org
Knowledge studies others / Wisdom is self-known;
Muscle masters brothers / Self-mastery is bone;
Content need never borrow / Ambition wanders blind;
Vitality cleaves to the marrow / Leaving death behind.    --Tao 33 (Bynner)