On 2. May 2025, at 13:09, Henry S. Thompson <ht=40inf.ed.ac...@dmarc.ietf.org> 
wrote:
> 
> Carsten Bormann writes:
> 
>> On 2. May 2025, at 12:04, Henry Thompson via Datatracker <nore...@ietf.org> 
>> wrote:
>>> 
>>>  ["26bc4LT-ac6q2KI6cBW5es", "family_name", "M%xc3%xb6bius"]   [2]
>> 
>> The weird %x notation in the third element has nothing to do with
>> JSON, which makes it difficult for me to understand the rest of what
>> you are trying to say.
> 
> Apologies for the difficulty, but this is a very tricky area, in which
> I think this spec. needs to be very careful to illustrate accurately
> all of UNICODE characters, 
>  * JSON strings (as type instances), components of JSON objects

(I generally call these JSON data items.)
These can easily be notated in JSON.

>  * What RFC 8259 calls "JSON text", the kind of thing you might find
>    in a file or see rendered on screen

Right, JSON text is well-defined (I would call this an “encoded JSON data 
item”).

>  * UTF-8 encoded JSON text, i.e. byte sequences which when decoded
>    result in JSON text which, when parsed, yields JSON objects.

For IETF purposes, JSON text is always UTF-8 encoded, so there is no difference.

> The problem you've encountered arises when one tries to illustrate
> UTF-8 byte sequences in an unambiuous way in, for example, an IETF
> RFC.

You can always write the whole thing in hex.
But typically that is really needed only in very few places, and I think we can 
assume that readers of this document understand JSON at least a little bit.
Apart from that, you can use JSON’s \u escapes (but then you get different JSON 
text).

> My recommendation is to follow RFC 8259's lead, and use e.g. "%xC3"
> for that purpose.

Ah, that notation in RFC 8259 is ABNF (STD68), which is completely different 
from JSON instances, and therefore mixing this up is highly confusing.
You are using ABNF in byte mode here (normally we use ABNF to define sequences 
of Unicode scalar values).
In ABNF byte mode, your array above would be:

my-string = "[" %x22 %s"26bc4LT-ac6q2KI6cBW5es" %x22 ", " %x22 %s"family_name" 
%x22 ", " %x22 %s"M" %xc3 %xb6 %s"bius" %x22 "]"

That is about as confusing as you can get, so please don’t do that.

(You can write this JSON text as a JSON-encoded JSON text string data item 
while staying in ASCII:
"[\"26bc4LT-ac6q2KI6cBW5es\", \"family_name\", \"M\u00f6bius\"]"
)

Grüße, Carsten

_______________________________________________
OAuth mailing list -- oauth@ietf.org
To unsubscribe send an email to oauth-le...@ietf.org

Reply via email to