Re: [Json] In "praise" of UTF-16

Anders Rundgren <anders.rundgren.net@gmail.com> Tue, 03 September 2019 05:17 UTC

Return-Path: <anders.rundgren.net@gmail.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 4BA53120105 for <json@ietfa.amsl.com>; Mon, 2 Sep 2019 22:17:33 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.998
X-Spam-Level:
X-Spam-Status: No, score=-1.998 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
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 oBg8vpXYq89t for <json@ietfa.amsl.com>; Mon, 2 Sep 2019 22:17:31 -0700 (PDT)
Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6545B1200DF for <json@ietf.org>; Mon, 2 Sep 2019 22:17:31 -0700 (PDT)
Received: by mail-wr1-x42f.google.com with SMTP id b16so15882382wrq.9 for <json@ietf.org>; Mon, 02 Sep 2019 22:17:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=qw5AuIGNXlCLpPrEnUbrE4oPeRIuuvfWZ+/x6EX4M+w=; b=BIqIg7/RYipTduh5/iak2NyGiUcpStutVT9wj8KsnxtMJRcEoZ8hVobGyXQMhSvO2N HOuJ5a/7hEPmgyX4/xeChwdKz92OK6VMBCiXDBPOi/OcqTfQ3en//ZDRjen/w2a9blce pTvU+F5por87ba/n673aV6ActlfR4d/2aP+tQG7MMOpgqu3wzuHl55NEN8PbS58SPGb8 RECmd9yRMuzDFgzaVfXzEJRickry+vdtxcEa4EFH2GmEW70O3NDYQ3soe01p+NDBYBzM 18SbEEd53gsdR0zAwT0KTogH0gTjCPlORESzsrr680gD75b/6ax4tH3DtnH1Hs13V4i1 K2eA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=qw5AuIGNXlCLpPrEnUbrE4oPeRIuuvfWZ+/x6EX4M+w=; b=nTgE9Jh/L1PYXfzBROH7F7em7Q4uqcenXdoKdIXe9emq7lxIAJLly3+MTjsEU/4Ry3 zzeSraz0Pu1ix4gjmKN8rGYvvA/PQOMyK12D2rOssVtMiFCWYeyUTKBLvcXVGm0Wdo+D A2uY7vzYxdxh6wTnocPrVGxeu23PD643u7oaSAXT6Cl/zq6wYIl9gKqku0lL0GOJKGXJ KteFaNH3D7k87jZzBknfUgl1zDEyGGi5FpnoicpmeihJc0Rgb3wpzRfBkbxOBoHSNJ+D V921apxMtwONcpuNPHC6/Nk0b+CWFbZppXlSgTiqXZIu6PNNNKj23Crae8iw8ZB72V9m e+Cg==
X-Gm-Message-State: APjAAAW3kRY6U39gbsMc+6eU7wMcAMz10R5wiqwo3FrpkKBzsTyjPji2 rnqkSAQq/SRGOtHHRbaeWDA=
X-Google-Smtp-Source: APXvYqyDtAwha0JStpXdkmsYrhcElqwwS0L0M9Q9kY+r+kFWaBr+8nhejVTqa45anhQ1VB8nSdGmIQ==
X-Received: by 2002:adf:f5c5:: with SMTP id k5mr37468364wrp.42.1567487849734; Mon, 02 Sep 2019 22:17:29 -0700 (PDT)
Received: from [192.168.1.79] (25.131.146.77.rev.sfr.net. [77.146.131.25]) by smtp.googlemail.com with ESMTPSA id z189sm8669380wmc.25.2019.09.02.22.17.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Sep 2019 22:17:28 -0700 (PDT)
To: Nico Williams <nico@cryptonector.com>, Carsten Bormann <cabo@tzi.org>
Cc: "json@ietf.org" <json@ietf.org>
References: <cc3dc24d-3e13-e319-e48f-7b52ddd017d0@gmail.com> <00231270-86DF-4AD2-949E-25B04D518577@tzi.org> <20190902211744.GA7920@localhost> <40386571-301A-47BD-937D-55666566CFB5@tzi.org> <20190902214047.GB7920@localhost>
From: Anders Rundgren <anders.rundgren.net@gmail.com>
Message-ID: <bde7a24d-8ae7-45e3-c8d8-86e9075c7f9b@gmail.com>
Date: Tue, 03 Sep 2019 07:17:25 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0
MIME-Version: 1.0
In-Reply-To: <20190902214047.GB7920@localhost>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/TZk6VrTpRfL_VISXx3WCygpAA5g>
Subject: Re: [Json] In "praise" of UTF-16
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.29
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: <https://mailarchive.ietf.org/arch/browse/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, 03 Sep 2019 05:17:33 -0000

{
   "mildIrony": "Thanx Nico and Carsten for your \"encouraging\" input",
   "applicableEmojis": "\ud83d\udca9\ud83d\ude01"
}

More seriously, you are wasting your precious cycles on already solved and quite simple problems:
https://chromium.googlesource.com/android_tools/+/78ccfd5f7e4880597fd90c61453a3be0e7aee5f0/sdk/sources/android-21/java/lang/Character.java#2058
The slight platform "bias" doesn't actually matter, it is the result that counts.

Personally, I found it more worthwhile looking into the [previously] unsolved problem: canonical serialization of 64-bit doubles.
This was clearly out of my league but I got some excellent help on the way.  The JCS number test suite passes without a glitch for Java, JavaScript, C#, Python and Go:
https://github.com/cyberphone/json-canonicalization/tree/master/testdata#es6-numbers
This scheme also have a clear platform bias.  In fact, the entire JCS specification (modulo sorting) is 100% compatible with ES6's JSON.stringify().

Anyway, if you think that JCS is controversial, that's nothing compared to what it is targeted for:
https://lists.w3.org/Archives/Public/public-payments-wg/2019Sep/0000.html
The 5-level signature depth required made the [previously] mandatory B64U wrapping schemes look really stupid.

thanx,
Anders
https://mobilepki.org/jws-jcs/home