public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: "Frank Ch. Eigler via Elfutils-devel" <elfutils-devel@sourceware.org>
Cc: Mark Wielaard <mark@klomp.org>,
	 "Frank Ch. Eigler" <fche@redhat.com>,
	Luca Boccassi <luca.boccassi@gmail.com>
Subject: Re: [PATCH v2] libebl: recognize FDO Packaging Metadata ELF note
Date: Tue, 30 Nov 2021 17:49:58 +0100	[thread overview]
Message-ID: <87czmhbnbd.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <20211130162352.GC17988@redhat.com> (Frank Ch. Eigler via Elfutils-devel's message of "Tue, 30 Nov 2021 11:23:52 -0500")

* Frank Ch. Eigler via Elfutils-devel:

> Hi -
>
> On Tue, Nov 30, 2021 at 12:25:41PM +0100, Mark Wielaard wrote:
>> [...]
>> The spec does explain the requirements for JSON numbers, but doesn't
>> mention any for JSON strings or JSON objects. It would be good to also
>> explain how to make the strings and objects unambiguous. [...]
>> For Objects it should require that all names are unique. [...]
>> For Strings it should require that \uXXXX escaping isn't used [...]
>> 
>> That should get rid of various corner cases that different parsers are
>> known to get wrong. 
>
> Are such buggy parsers seen in the wild, now, after all this time with
> JSON?  It seems to me it's not really elfutils' or systemd's place to
> impose -additional- constraints on customary JSON.

JSON has been targeted at the Windows/Java UTF-16 world, there is always
going to be a mismatch if you try to represent it in UTF-8 or anything
that doesn't have surrogate pairs.

>> Especially \uXXXX escaping is really confusing when using the UTF-8
>> encoding (and it is totally necessary since UTF-8 can express any
>> valid UTF character already).
>
> Yes, and yet we have had the bidi situation recently where UTF-8 raw
> codes could visually confuse a human reader whereas escaped \uXXXX
> wouldn't.  If we forbid \uXXXX unilaterally, we literally become
> incompatible with JSON (RFC8259 7. String. "Any character may be
> escaped."), and for what?

RFC 8259 says this:

   However, the ABNF in this specification allows member names and
   string values to contain bit sequences that cannot encode Unicode
   characters; for example, "\uDEAD" (a single unpaired UTF-16
   surrogate).  Instances of this have been observed, for example, when
   a library truncates a UTF-16 string without checking whether the
   truncation split a surrogate pair.  The behavior of software that
   receives JSON texts containing such values is unpredictable; for
   example, implementations might return different values for the length
   of a string value or even suffer fatal runtime exceptions.

A UTF-8 environment has to enforce *some* additional constraints
compared to the official JSON syntax.

Thanks,
Florian


  reply	other threads:[~2021-11-30 16:50 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-19  0:31 [PATCH] " luca.boccassi
2021-11-21 16:33 ` Mark Wielaard
2021-11-21 19:54   ` Luca Boccassi
2021-11-21 19:43 ` [PATCH v2] " luca.boccassi
2021-11-25 17:02   ` Luca Boccassi
2021-11-30 11:25     ` Mark Wielaard
2021-11-30 12:37       ` Luca Boccassi
2021-11-30 16:23       ` Frank Ch. Eigler
2021-11-30 16:49         ` Florian Weimer [this message]
2021-11-30 20:04           ` Mark Wielaard
2021-12-02 15:16           ` Frank Ch. Eigler
2021-12-02 15:44             ` Florian Weimer
2021-12-05 17:36       ` Mark Wielaard
2022-03-24 23:14         ` Mark Wielaard
2022-03-24 23:14           ` [PATCH 1/3] libelf: Sync elf.h from glibc Mark Wielaard
2022-03-24 23:14           ` [PATCH 2/3] libebl: recognize FDO Packaging Metadata ELF note Mark Wielaard
2022-03-24 23:14           ` [PATCH 3/3] elflint: Recognize NT_FDO_PACKAGING_METADATA Mark Wielaard
2022-03-25 11:17           ` [PATCH v2] libebl: recognize FDO Packaging Metadata ELF note Luca Boccassi
2022-03-25 13:39             ` Mark Wielaard
2022-03-25 13:52               ` Luca Boccassi
2022-03-25 14:47                 ` Mark Wielaard
2022-03-25 14:55                   ` Luca Boccassi
2022-03-26 16:33                     ` Mark Wielaard
2022-03-26 16:57                       ` Luca Boccassi
2022-03-26 18:19                         ` Luca Boccassi
2022-03-28  9:57                           ` Mark Wielaard
2022-03-28 10:41                             ` Luca Boccassi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87czmhbnbd.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=elfutils-devel@sourceware.org \
    --cc=fche@redhat.com \
    --cc=luca.boccassi@gmail.com \
    --cc=mark@klomp.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).