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

Kari Hurtta <hurtta-ietf@elmme-mailer.org> Wed, 14 December 2016 17:48 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 9A28D129EAE for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 14 Dec 2016 09:48:40 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.797
X-Spam-Level:
X-Spam-Status: No, score=-9.797 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=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
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 YhvD4UmMyF5U for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 14 Dec 2016 09:48:38 -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 D6D22129EB0 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Wed, 14 Dec 2016 09:48:32 -0800 (PST)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1cHDcA-0004vC-52 for ietf-http-wg-dist@listhub.w3.org; Wed, 14 Dec 2016 17:45:14 +0000
Resent-Date: Wed, 14 Dec 2016 17:45:14 +0000
Resent-Message-Id: <E1cHDcA-0004vC-52@frink.w3.org>
Received: from titan.w3.org ([128.30.52.76]) by frink.w3.org with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <hurtta@siilo.fmi.fi>) id 1cHDbx-0000Ys-Pr for ietf-http-wg@listhub.w3.org; Wed, 14 Dec 2016 17:45:01 +0000
Received: from smtpvgate.fmi.fi ([193.166.223.36]) by titan.w3.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from <hurtta@siilo.fmi.fi>) id 1cHDbr-0001Mb-4F for ietf-http-wg@w3.org; Wed, 14 Dec 2016 17:44:56 +0000
Received: from basaari.fmi.fi (basaari.fmi.fi [193.166.211.14]) (envelope-from hurtta@siilo.fmi.fi) by smtpVgate.fmi.fi (8.13.8/8.13.8/smtpgate-20161014/smtpVgate) with ESMTP id uBEHe3tt008732 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 14 Dec 2016 19:40:03 +0200
Received: from shell.siilo.fmi.fi by basaari.fmi.fi with ESMTP id uBEHe3X9029954 ; Wed, 14 Dec 2016 19:40:03 +0200
Received: from shell.siilo.fmi.fi ([127.0.0.1]) by shell.siilo.fmi.fi with ESMTP id uBEHe3rH024975 ; Wed, 14 Dec 2016 19:40:03 +0200
Received: by shell.siilo.fmi.fi id uBEHdwiq024972; Wed, 14 Dec 2016 19:39:58 +0200
Message-Id: <201612141739.uBEHdwiq024972@shell.siilo.fmi.fi>
In-Reply-To: <CACweHNBYf-UuxsKNxYakt22rgku9xEP4YK4yL2R+=vMf_uB2Vg@mail.gmail.com>
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>
To: Matthew Kerwin <matthew@kerwin.net.au>
Date: Wed, 14 Dec 2016 19:39:58 +0200
Sender: hurtta@siilo.fmi.fi
From: 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>, Kari Hurtta <hurtta-ietf@elmme-mailer.org>, Ilari Liusvaara <ilariliusvaara@welho.com>, HTTP working group mailing list <ietf-http-wg@w3.org>, Poul-Henning Kamp <phk@varnish-cache.org>
X-Mailer: ELM [version ME+ 2.5 PLalpha44]
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset="UTF-8"
X-Filter: smtpVgate.fmi.fi: 3 received headers rewritten with id 20161214/16480/01
X-Filter: smtpVgate.fmi.fi: ID 16480/01, 1 parts scanned for known viruses
X-Filter: basaari.fmi.fi: ID 306903/01, 1 parts scanned for known viruses
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (smtpVgate.fmi.fi [193.166.223.36]); Wed, 14 Dec 2016 19:40:08 +0200 (EET)
Received-SPF: none client-ip=193.166.223.36; envelope-from=hurtta@siilo.fmi.fi; helo=smtpVgate.fmi.fi
X-W3C-Hub-Spam-Status: No, score=-6.5
X-W3C-Hub-Spam-Report: AWL=0.470, BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-3.099, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: titan.w3.org 1cHDbr-0001Mb-4F b1fa4e9728018d214b2100fb56fbe378
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/201612141739.uBEHdwiq024972@shell.siilo.fmi.fi>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/33197
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>

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...}
> 
> 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. }


Although

	EmbeddedUnicodeChar =  %x5C.75.27 4*6HEXDIG %x27

works for me.
 
> 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.


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

/ Kari Hurtta