Re: [I18ndir] [art] Just uploaded draft-bray-unichars-03

Asmus Freytag <asmusf@ix.netcom.com> Sat, 09 September 2023 21:32 UTC

Return-Path: <asmusf@ix.netcom.com>
X-Original-To: i18ndir@ietfa.amsl.com
Delivered-To: i18ndir@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B53BAC151556 for <i18ndir@ietfa.amsl.com>; Sat, 9 Sep 2023 14:32:55 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.996
X-Spam-Level:
X-Spam-Status: No, score=-1.996 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, NICE_REPLY_A=-0.091, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=earthlink.net
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Fp_3rPwPjgRl for <i18ndir@ietfa.amsl.com>; Sat, 9 Sep 2023 14:32:53 -0700 (PDT)
Received: from mta-101a.earthlink-vadesecure.net (mta-101a.earthlink-vadesecure.net [51.81.61.60]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 56497C1519A1 for <i18ndir@ietf.org>; Sat, 9 Sep 2023 14:32:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; bh=Lrk4FlOY4NxpjieRVheb/qWB31x7CA2dH5ElkX MHHAU=; c=relaxed/relaxed; d=earthlink.net; h=from:reply-to:subject: date:to:cc:resent-date:resent-from:resent-to:resent-cc:in-reply-to: references:list-id:list-help:list-unsubscribe:list-subscribe:list-post: list-owner:list-archive; q=dns/txt; s=dk12062016; t=1694295172; x=1694899972; b=IiHHoN0S5+Qu4Q3kgJ0meIWuMtkJUj1z0oGFlNQJgxB3+tJTyP74pzD 2bfir8KvGYxT5ZmgeDaBrNYQgldPc5Cja/qLU3itMs7069IwJEHdzwYzlnoXVgGYsdx6RNf vicTAoa0PWPAKxrqIR5qtUkjSdPaHFEKudClDepsMiupYTnto4pFtbTsCQt5oqqiE8LK94Y HJNQDptzKdHoCyJCmEBTm7KfFVOEKF6PgLDAYygYvtqxo1WGW2MmldhibRWqAAaLvC5ZZjl VLt6A/L1Dq8cCXe8XXPjHsd4+BAg/tf8MwNMCM7HWq6HEZB+mgN+SDOrFP6XySQa6CYci2w tyw==
Received: from [10.71.219.206] ([192.252.212.46]) by vsel1nmtao01p.internal.vadesecure.com with ngmta id 0cf1481c-1783587b704cdc3d; Sat, 09 Sep 2023 21:32:52 +0000
Content-Type: multipart/alternative; boundary="------------zBVvdHwfd7VIJJ4l1cYm0yje"
Message-ID: <1ad33b22-a572-57fb-8020-58b185da1525@ix.netcom.com>
Date: Sat, 09 Sep 2023 14:32:32 -0700
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0
Content-Language: en-US
To: i18ndir@ietf.org
References: <CAHBU6is50TkpDsqXTp6WxdVSgE66j3gGHZ60ey2jFYbefaHFJw@mail.gmail.com> <20230909165843.GlTJy%steffen@sdaoden.eu> <CAChr6Sz=rMqwp3GOoqGgSsxE8Pqe3GCTqaOLpBO=YN+7v1Ui8Q@mail.gmail.com>
From: Asmus Freytag <asmusf@ix.netcom.com>
In-Reply-To: <CAChr6Sz=rMqwp3GOoqGgSsxE8Pqe3GCTqaOLpBO=YN+7v1Ui8Q@mail.gmail.com>
Authentication-Results: earthlink-vadesecure.net; auth=pass smtp.auth=asmusf@ix.netcom.com smtp.mailfrom=asmusf@ix.netcom.com;
Archived-At: <https://mailarchive.ietf.org/arch/msg/i18ndir/s1x6d4OT9ov1747au0VfmkUeTj4>
Subject: Re: [I18ndir] [art] Just uploaded draft-bray-unichars-03
X-BeenThere: i18ndir@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Internationalization Directorate <i18ndir.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/i18ndir>, <mailto:i18ndir-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/i18ndir/>
List-Post: <mailto:i18ndir@ietf.org>
List-Help: <mailto:i18ndir-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/i18ndir>, <mailto:i18ndir-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 09 Sep 2023 21:32:55 -0000

Your comments triggered some reflections on the drafts and on comments I 
submitted earlier. See below.
A./

On 9/9/2023 1:56 PM, Rob Sayre wrote:
> I gave it a close read again. I came up with this:
>
>
> 5. Refining Character Repertoires
>
> The IETF typically uses well-known data formats such as JSON, I-JSON, 
> CBOR, YAML, and XML. These formats have default character repertoires. 
> For example, JSON allows member names and string values to include any 
> Unicode code points, including all the problematic types; the 
> following is a legal JSON document:
>
> [ big edit from the current draft, shorter, but take it or leave it. ]
>
>
> {"example": "\u0000\U0089\uDEAD\u7FFFF"}
>
> The value of the "example" field contains the C0 Control NUL, the C1 
> Control "CHARACTER TABULATION WITH JUSTIFICATION", an unpaired 
> surrogate, and the noncharacter U+7FFFF. It is unlikely to be useful 
> as the value of a text field. It cannot be serialized into legal 
> UTF-8, but many libraries will silently parse this and generate an 
> ill-formed UTF-8 string. Implementors must be prepared to deal with 
> these sorts of problematic code points
>
> [ The first part, "unlikely to be useful as the value of a text 
> field", is good. But, the next part mixes "legal" and "ill-formed", 
> and I don't think that is a good idea. There is still a lowercase 
> requirement after that, and I think I disagree. Implementors do not 
> have to be "prepared to deal with these sorts of problematic code 
> points". Maybe: "Some messages will contain these 
> problematic code points". That is true, but you don't have to deal 
> with them. ]

I agree with you that legal should be changed to "well-formed" which is 
a defined term.

I disagree a bit with your conclusion. Implementers SHOULD always be 
prepared to deal with ill-formed input. It's the nature of how to deal 
with ill-formed input that can vary based on the circumstances and context.

If an protocol declares the "problematic" code points off limits, then 
an implementation might reject such ill-formed or modify it in a way 
that flags it as erroneous. For an example see the way the Unicode 
Standard suggests dealing with ill-formed UTF-8.

There are security concerns attached to how an implementation deals with 
ill-formed input, but we should be clear that producing ill-formed 
output is not "dealing" with the situation. In fact, even "behavior is 
unspecified" is a bad choice from a security point of view.

If you have a data format that puts limits on what is allowed, then if 
you are guaranteed that your input is "well-formed" it would be 
redundant to take elaborate measures to "deal" with ill-formed input. 
However, in that case, rejecting the input or throwing an exception 
would still be more appropriate reactions than ignoring the fact that 
the input is ill-formed.

>
>
>
> It is unlikely that anyone specifying a new data format would choose 
> to allow this character repertoire.
>
> [ Instead: The JSON character repertoire is too permissive, so it's 
> best for new specifications to require that the contents of member 
> names and string values contain only Useful Assignables (see Section 
> 4.2). ]
recte: code point repertoire
>
>
>
> Then, I got to the end, and noticed that "character repertoire" might 
> not be the best choice. "Character encoding" or "character set"? 
> "Vocabulary"? No shade for the authors here, writing about language 
> itself is really difficult.

I'm a proponent of the term "repertoire" for precisely the purpose of 
indicating the contents of a subset of characters.

An "encoding" is associated both with the repertoire and the mapping to 
identifying numbers for each character. As the mapping is supplied by 
the Unicode Standard, a subset would not be a new "encoding".

The term "vocabulary" would seem more appropriate for a collection of 
symbolic names, than individual characters.

I've pointed out in earlier comments to the authors, there are other 
IETF standards that already use the term repertoire in the sense of a 
collection of elements that are based on Unicode characters. In some 
cases the repertoire elements are characters, but depending on the 
specification they may also be character sequences.

Generally, when we speak about a character set, we use that term in a 
way that's not fully congruent with "set of characters"; most commonly, 
the term "character set" refers to formal specification like ASCII, ISO 
8850/1, Unicode, etc, which both define a maximal repertoire, and an 
encoding. Sometimes they also define subsets and different encoding forms.

The one change I would make (and I admit that I overlooked it) would be 
to change "character repertoire" to "code point repertoire" for any 
repertoire that is not limited to code points assigned to characters.

A./


>
> thanks,
> Rob
>
>
>
> On Sat, Sep 9, 2023 at 10:15 AM Steffen Nurpmeso <steffen@sdaoden.eu> 
> wrote:
>
>     Tim Bray wrote in
>      <CAHBU6is50TkpDsqXTp6WxdVSgE66j3gGHZ60ey2jFYbefaHFJw@mail.gmail.com>:
>      |See https://www.ietf.org/archive/id/draft-bray-unichars-03.html
>      |
>      |A bunch of minor corrections and improvements, thanks to
>     everyone for that,
>      |especially James Manger for noticing that the ABNF was entirely
>     wrong in
>      |one place.
>      |
>      |The word “useless” has been replaced by “legacy”.
>      |
>      |I think the feedback was pretty clear that the draft needed to
>     be more
>      |opinionated; just because we document the existence of the
>     default JSON
>      |repertoire (“all the code points”) doesn’t mean that anyone
>     should use it
>      |in the present or future. So, introduced a new section “Refining
>     Character
>      |Repertoires” to highlight those issues and offer a suggestion.
>
>     In 2.2 i would not give the count on code point types.
>     Instead i would only give the problem statement "among Unicode
>     code point types .. are questionable".  This seems more generic.
>
>     In 2.2.2.2 i would not say "legacy controls", and that they are
>     "mostly obsolete".  ECMA-48 is very alive in at least the POSIX
>     aka Linux world, for many purposes, for example terminal
>     interaction.  "Likely to occur in data as a result of
>     a programming error"?  Any preformatted Unix manual page will come
>     with lots of CSI sequences, or backspace-based ones.
>     ASCII NUL is the base of ISO C-style strings.  In fact many
>     network protocols (not enough!!) still seem to use
>     KEY=VALUE\0KEY=VALUE\0\0 style transports.
>
>     In 5.:
>
>       [JSON..] It cannot be serialized into legal UTF-8, but many
>       libraries will silently parse this and generate an ill-formed
>       UTF-8 string. Implementors must be prepared to deal with these
>       sorts of problematic code points.
>
>     But RFC 3629 is very clear and says in 3. (being lengthy)
>
>        The definition of UTF-8 prohibits encoding character numbers
>     between
>        U+D800 and U+DFFF, which are reserved for use with the UTF-16
>        encoding form (as surrogate pairs) and do not directly represent
>     []
>        characters.  When encoding in UTF-8 from UTF-16 data, it is
>     necessary
>        to first decode the UTF-16 data to obtain character numbers, which
>        are then encoded in UTF-8 as described above.  This contrasts with
>        CESU-8 [CESU-8], which is a UTF-8-like encoding that is not
>     meant for
>        ...
>
>     So even the weird JSON "string" can be made valid UTF-8, one just
>     has to walk around the corner.  (Possibly.)
>     Sorry, but _I_ do not get that JSON supports _that_ "string",
>     RFC 8259, 7.:
>
>        To escape an extended character that is not in the Basic
>     Multilingual
>        Plane, the character is represented as a 12-character sequence,
>        encoding the UTF-16 surrogate pair.
>
>     And then in 8.
>
>       8.  String and Character Issues
>       8.1.  Character Encoding
>          JSON text exchanged between systems that are not part of a
>          closed ecosystem MUST be encoded using UTF-8 [RFC3629].
>
>     This is a total contradiction, sorry.  I. Hate. JSON.
>     But that does not help anyone.
>
>     So i mean _if_ i would write such a RFC _i_ would not hammer your
>     sentence on the table, but i would then simply refer to RFC 3629
>     and say that implementors shall be prepared to convert the JSON
>     standard (grrr) string .. to the UTF-8 standard?
>
>     5. also says
>
>        It is unlikely that anyone specifying a new data format would
>        choose to allow this character repertoire.
>
>     And
>
>        A protocol based on JSON could be made more robust and
>        implementor-friendly by requiring that the contents of member
>        names and string values contain only Useful Assignables
>
>     No.  Not me.  Sorry .. we are talking string data?
>     I mean, with your restriction one (possibly) cannot even generate
>     a protocol that carries around Linux/POSIX path names?  Except by
>     mangling them to something likely non-reproducible (by leaving off
>     "evil" characters, or converting them to a replacement character;
>     which one, the Unicode one, or question mark?  Ah, it must be
>     ASCII question mark because the Unicode replacement character is
>     of the evil sort?).  Or have i misunderstood something ...
>     which can very well be the truth, of course.
>     So, even if you wipe away all of the above, a hint on replacement
>     characters in a document that restricts the usable set of Unicode
>     characters is well worth a thought.
>
>     Thank you.
>
>     --steffen
>     |
>     |Der Kragenbaer,                The moon bear,
>     |der holt sich munter           he cheerfully and one by one
>     |einen nach dem anderen runter  wa.ks himself off
>     |(By Robert Gernhardt)
>
>     _______________________________________________
>     art mailing list
>     art@ietf.org
>     https://www.ietf.org/mailman/listinfo/art
>
>