Re: Unicode escape sequence | Re: draft-ietf-httpbis-header-structure-00, unicode range

Matthew Kerwin <matthew@kerwin.net.au> Thu, 15 December 2016 02:01 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 657471295A5 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 14 Dec 2016 18:01:14 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.796
X-Spam-Level:
X-Spam-Status: No, score=-9.796 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-2.896, SPF_HELO_PASS=-0.001, SPF_PASS=-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 MHYUttYGf9xA for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 14 Dec 2016 18:01:11 -0800 (PST)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2376D129516 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Wed, 14 Dec 2016 18:01:11 -0800 (PST)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1cHLJX-00046x-NK for ietf-http-wg-dist@listhub.w3.org; Thu, 15 Dec 2016 01:58:31 +0000
Resent-Date: Thu, 15 Dec 2016 01:58:31 +0000
Resent-Message-Id: <E1cHLJX-00046x-NK@frink.w3.org>
Received: from mimas.w3.org ([128.30.52.79]) by frink.w3.org with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <phluid61@gmail.com>) id 1cHLJG-00045Q-9p for ietf-http-wg@listhub.w3.org; Thu, 15 Dec 2016 01:58:14 +0000
Received: from mail-it0-f68.google.com ([209.85.214.68]) by mimas.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <phluid61@gmail.com>) id 1cHLJ9-0003ew-2n for ietf-http-wg@w3.org; Thu, 15 Dec 2016 01:58:09 +0000
Received: by mail-it0-f68.google.com with SMTP id c20so2033789itb.0 for <ietf-http-wg@w3.org>; Wed, 14 Dec 2016 17:57:46 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=pg3/zxOTifxN387/HYofmqRipNMYdBVvfAipn/vIR6U=; b=VZ32hXxudAES6JytwWvreVU4OhkhX3eFAtcXG0IxReKPiJlmX4SIJw86I3/si37Mio yaLhCxFBHjA0jUu53SDqqoUcCIA5j0oePQN0TBwOMRdY83yAb/GvN5nx8IJl/QsurXyf m2KWLDw43bIm71qGVj8QO5XZqzuXpTlk9oCnwk1PhiDktCNVufahOmdRgnq80um+FEzX 65bTFxgb7QQpEjgcyXr9QiUEBMfaq8Mylu+fYWPSoYVSnUCFSl3qyGxwn6SfKbDWeZeP pa9SKD9QcKgNYqfOWiUmyNfgBWsEkQMNT+ePQ8dADPtG6LDfQZezIMVumjuTBVClIrz+ 7OIQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=pg3/zxOTifxN387/HYofmqRipNMYdBVvfAipn/vIR6U=; b=YwO3BtNBRbfrKO3RW9lCMMfd4bqTSJx9yMjVm+NkHb1xwjk8q3AEJXePSGTRZ/sO12 7y6g+z1AVPER3SUdDe0gW9mb3IPXpLlIh5q0OQ52W6z/O27xKns87zhbDuNlfHKqBH0g jWE4yow5TQ2dA75sNfyK9uGr/a7YKC6xGzRppK3+KGbbzd3U9oKXy8ph6kT+CM08Y5H3 jbjOFMfQPD28rbnA2/ZA8J79ECNnH59Hs2c9QTC5Tbo/7K+874EGmD5i9fy89iVxeEvk 8lOhWsaKCkky4WftiVeVatWmw+ggFJF0E5usrF7lzhwbt8SeZhzPuJlnwYAnpQzGtvun 0WiA==
X-Gm-Message-State: AKaTC00Itbg+nWGl3vI32D/fnVXAdQcQ4EPrN1c448Cz2rNzGLwVGvgMHuMZvSPnIMZdSCuxyOf07ivs3+Ceaw==
X-Received: by 10.36.233.66 with SMTP id f63mr10875583ith.55.1481767060910; Wed, 14 Dec 2016 17:57:40 -0800 (PST)
MIME-Version: 1.0
Sender: phluid61@gmail.com
Received: by 10.107.135.84 with HTTP; Wed, 14 Dec 2016 17:57:40 -0800 (PST)
In-Reply-To: <201612141739.uBEHdwiq024972@shell.siilo.fmi.fi>
References: <20161213173327.C1F7D1714B@welho-filter2.welho.com> <20161213175419.GA7943@LK-Perkele-V2.elisa-laajakaista.fi> <25434.1481665395@critter.freebsd.dk> <201612140628.uBE6SO3L025885@shell.siilo.fmi.fi> <36792.1481701328@critter.freebsd.dk> <CACweHNDKgWQewZHb=Kz3_2=41M58sY5472Q5OwpqPLxorvkzHQ@mail.gmail.com> <37223.1481707288@critter.freebsd.dk> <3a65ca44-f652-3b14-6d64-46f35b32df57@isode.com> <725824b9-de61-2650-4007-fb5b026bc7a6@gmx.de> <87f1efaf-74c5-f02b-d09e-a721afa86032@isode.com> <0cce5fdf-5f1a-4fd3-2e3a-e810a34baccb@gmx.de> <CACweHNBYf-UuxsKNxYakt22rgku9xEP4YK4yL2R+=vMf_uB2Vg@mail.gmail.com> <201612141739.uBEHdwiq024972@shell.siilo.fmi.fi>
From: Matthew Kerwin <matthew@kerwin.net.au>
Date: Thu, 15 Dec 2016 11:57:40 +1000
X-Google-Sender-Auth: yB1ZLkwrVxbJchHI9MFrJE4uAq8
Message-ID: <CACweHNDbv9dDXqjpU61HvfpgZ6Dt4S-CG=GjwOZcwaZh6LEirQ@mail.gmail.com>
To: Kari Hurtta <hurtta-ietf@elmme-mailer.org>
Cc: Julian Reschke <julian.reschke@gmx.de>, Alexey Melnikov <alexey.melnikov@isode.com>, Poul-Henning Kamp <phk@phk.freebsd.dk>, Ilari Liusvaara <ilariliusvaara@welho.com>, HTTP working group mailing list <ietf-http-wg@w3.org>, Poul-Henning Kamp <phk@varnish-cache.org>
Content-Type: multipart/alternative; boundary="94eb2c115e8c4e38ab0543a8c7e5"
Received-SPF: pass client-ip=209.85.214.68; envelope-from=phluid61@gmail.com; helo=mail-it0-f68.google.com
X-W3C-Hub-Spam-Status: No, score=-4.8
X-W3C-Hub-Spam-Report: AWL=-1.121, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: mimas.w3.org 1cHLJ9-0003ew-2n 6365a435601a67a4f91b5b029286855a
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Unicode escape sequence | Re: draft-ietf-httpbis-header-structure-00, unicode range
Archived-At: <http://www.w3.org/mid/CACweHNDbv9dDXqjpU61HvfpgZ6Dt4S-CG=GjwOZcwaZh6LEirQ@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/33199
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

On 15 December 2016 at 03:39, Kari Hurtta <hurtta-ietf@elmme-mailer.org>
wrote:

> Matthew Kerwin <matthew@kerwin.net.au>: (Wed Dec 14 13:53:45 2016)
> > It says that "forms that use explicit string delimiters are generally
> > preferred over other alternatives. In many contexts, symmetric paired
> > delimiters are easier to recognize and understand than visually unrelated
> > ones." So brackets are good.
> >
> > And while it advises against using Perl's \x{NNNN...} syntax (because of
> > potential ambiguities with two-digit hex codes), it doesn't say anything
> at
> > all about \u{N...}
> >
>

​I have should noted here that Ruby uses this \u{N...} syntax, including
the lower limit of one hexadecimal digit.  This is a valid string literal
in Ruby:

"\u{df}\u{9}\u{1f602}"​



> > Curly braces cost 14+15 bits in HPACK, parentheses 10+10 (incidentally
> > cheaper than single quotes, which are 11+11). It's also convenient that
> > little 'u' is one bit cheaper than little 'x'.
> >
> > I don't think parentheses are at too much risk of needing escaping, so it
> > seems like the solution that goes with BCP 137, and compresses alright
> with
> > HPACK, is:
> >
> >     %x5c.75.28 1*6HEXDIGIT %x29
> >
> > It's still a little bit clunky for things like "Stra\u(df)e", but not so
> > bad for emoji "\u(1f602)" and somewhere in between for Hiragana "
> > \u(3053)\u(3093)\u(306b)\u(3064)".
>
>
> I think that this is best suggestion so far.
>
> But can this also be shorter ?
>
>      %x5c.28 1*6HEXDIGIT %x29
>
> Makes
>
>         \(3064)
>
>
> { Yes, it is not visible that this is hexadecimal. }
>
>
​There is precedent, although I'm not sure if it's a good precedent: the
"content" attribute in CSS uses:

    %5c 1*6HEXDIGIT

...which is both undelimited (which I oppose) and without an explicit
hexadecimal indicator (about which I'm mostly ambivalent.)​



>
> Although
>
>         EmbeddedUnicodeChar =  %x5C.75.27 4*6HEXDIG %x27
>
> works for me.
>
>
​I suppose it comes down to a question of which data we want to target for
optimisation, and then taking measurements and evaluating them.

It sounds like Julian thinks «%x5c.75 DELIM 1*6HEXDIGIT DELIM» "\u(abc)" is
verbose, and we don't have many opinions yet on «%x5c.28 1*6HEXDIGIT %x29​»
"\(abc)"

I'm not sure at what point this decision becomes so minor that it's just
paint on a bike shed. :)



> > Cheers​
> >
> >
> >
> > > Best regards, Julian
> > >
> > > PS: and, as a nit, it's strange that the syntax uses delimiters but
> > > doesn't allow sequences of 1 to 3 HEXDIGs...
> > >
> > >
> > ​Having just written "\u(df)" I kind of understand; it really feels like
> > I'm describing an octet rather than a codepoint. I don't think there's a
> > *technical* reason, though.
>
> Yes.
>
> >                              Is it alright to see "\u(9)" or an
> equivalent
> > in text?
>
>         Or is that "\(9)" alright if 'u' is also dropped.
>
> If that wanted to be avoid, that means
>
>         %x5c.75.28 3*6HEXDIGIT %x29
>
> or
>
>         %x5c.28 3*6HEXDIGIT %x29
>
> on my newest suggestion.
>
>
​Left-padding a with zeroes to make three digits screams "octal" at me,
even when they're not all octal digits, which elicits an even stronger
Pavlovian response. I think it has to be either
1*6
or
4*6
, and I lean towards
1*6
.

Cheers
-- 
  Matthew Kerwin
  http://matthew.kerwin.net.au/