Re: [Json] Wording on encoding; removing the table

Bjoern Hoehrmann <derhoermi@gmx.net> Fri, 22 November 2013 23:02 UTC

Return-Path: <derhoermi@gmx.net>
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 C4BAF1AE399 for <json@ietfa.amsl.com>; Fri, 22 Nov 2013 15:02:15 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.425
X-Spam-Level:
X-Spam-Status: No, score=-2.425 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-0.525, 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 LPYEBOSSn8k0 for <json@ietfa.amsl.com>; Fri, 22 Nov 2013 15:02:14 -0800 (PST)
Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by ietfa.amsl.com (Postfix) with ESMTP id C55521AE345 for <json@ietf.org>; Fri, 22 Nov 2013 15:02:13 -0800 (PST)
Received: from netb.Speedport_W_700V ([91.35.33.117]) by mail.gmx.com (mrgmx101) with ESMTPA (Nemesis) id 0LgdBZ-1VMTLk0lOf-00nvoY for <json@ietf.org>; Sat, 23 Nov 2013 00:02:05 +0100
From: Bjoern Hoehrmann <derhoermi@gmx.net>
To: Paul Hoffman <paul.hoffman@vpnc.org>
Date: Sat, 23 Nov 2013 00:02:07 +0100
Message-ID: <uhnv89pnulebdn9qsjuutr472aku18r0db@hive.bjoern.hoehrmann.de>
References: <v8av89128j49csd5bb5ba2rqrgschs4c79@hive.bjoern.hoehrmann.de> <BE35B0E6-6C71-47EB-BA29-08A32935D20E@vpnc.org>
In-Reply-To: <BE35B0E6-6C71-47EB-BA29-08A32935D20E@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:vizV0a3fTMa9owrDm7TlRsg9BIOa1dCRMG3OZBzYh1YWcbIYAqI vdTVGhtx8KSecuDwmFCCpX+9oZMBKhA9VGBk/bcp0xuoSAyNSUhzCBNMxWwTLM4J2KH3kQI w0couvF0BGDC1B3kD/T0gQRb5n5SRV9L2n2RznxClRZHq9L4sZfjhIGFdm2ZNxw0YsU5tYd B7fwrzIhjQunNxCCk9VAw==
Cc: JSON WG <json@ietf.org>
Subject: Re: [Json] Wording on encoding; removing the table
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, 22 Nov 2013 23:02:16 -0000

* Paul Hoffman wrote:
>Proposed replacement:
>
>   The default encoding for JSON transmitted over the Internet is UTF-8.
>   Transmitting JSON using other encodings may not be interoperable
>   unless the receiving system definitively knows the encoding.
>
>Does anyone have a technical objection to the proposed replacement? If 
>so, please state the error and (hopefully) a correction.

It is necessary for reasons of security and interoperability that all
application/json processors agree on how to get from the sequence of
bytes that make up the application/json entity to a sequence of integers
that are used in the ABNF definition of the JSON syntax. For example,

  data:application/json,%5B%22Bj+APY-rn%22%5D

Under the rules you propose, this can be interpreted as if it were

  ["Björn"]

An implementation that interprets it thus is fully conforming because
the bytes look like they are UTF-7 encoded text and the specification
does not unambiguously say that, no, the implementation must not take
it as UTF-7 encoded document, instead it must use UTF-8 to decode.

Under the rules of RFC 4627 there can be no UTF-7 encoded application/
json entities at all and processors are required to decode the example
using UTF-8.

Some web browsers had exactly this problem for a long time with other
formats, it is entirely unacceptable to go back to "just do whatever"
specifications for character encoding determination.
-- 
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/