[Cbor] Re: Tag for Number as String?
Carsten Bormann <cabo@tzi.org> Mon, 28 April 2025 18:55 UTC
Return-Path: <cabo@tzi.org>
X-Original-To: cbor@mail2.ietf.org
Delivered-To: cbor@mail2.ietf.org
Received: from localhost (localhost [127.0.0.1]) by mail2.ietf.org (Postfix) with ESMTP id 0AA462230515 for <cbor@mail2.ietf.org>; Mon, 28 Apr 2025 11:55:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at ietf.org
X-Spam-Flag: NO
X-Spam-Score: -4.189
X-Spam-Level:
X-Spam-Status: No, score=-4.189 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, T_SPF_PERMERROR=0.01] autolearn=ham autolearn_force=no
Received: from mail2.ietf.org ([166.84.6.31]) by localhost (mail2.ietf.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G9WEqsVIqh0w for <cbor@mail2.ietf.org>; Mon, 28 Apr 2025 11:55:52 -0700 (PDT)
Received: from smtp.zfn.uni-bremen.de (smtp.zfn.uni-bremen.de [IPv6:2001:638:708:32::21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail2.ietf.org (Postfix) with ESMTPS id 659A7223050D for <cbor@ietf.org>; Mon, 28 Apr 2025 11:55:52 -0700 (PDT)
Received: from smtpclient.apple (p5089af88.dip0.t-ipconnect.de [80.137.175.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4ZmXhk4p33zDCbf; Mon, 28 Apr 2025 20:55:50 +0200 (CEST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.500.181.1.5\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <F5F8496F-FC8F-4666-9A5B-C66C8C4E0669@justatheory.com>
Date: Mon, 28 Apr 2025 20:55:40 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <CE10A13E-611E-4467-BFB6-B04F70EC8F9D@tzi.org>
References: <DF53B36D-D442-47EC-A75A-85430BF9A764@justatheory.com> <8D7052CB-E394-4C38-9EEB-A198005042FE@tzi.org> <CA7E9F9C-9165-45D4-929D-770F055834DE@justatheory.com> <FA0DC658-B4A4-4EA6-8594-FC30A1F055B2@justatheory.com> <BB653129-A988-48DF-8D8D-544484F38FF7@justatheory.com> <5E5FC34C-4F76-4F66-93E5-3A66DC631C54@justatheory.com> <D35AE048-CE0C-4D64-BD63-1E1DFCB54C14@tzi.org> <F5F8496F-FC8F-4666-9A5B-C66C8C4E0669@justatheory.com>
To: "David E. Wheeler" <david@justatheory.com>
X-Mailer: Apple Mail (2.3826.500.181.1.5)
Message-ID-Hash: 2R7MV7HUSPB5VDKZ3DZ4M3S7DWTF2G7W
X-Message-ID-Hash: 2R7MV7HUSPB5VDKZ3DZ4M3S7DWTF2G7W
X-MailFrom: cabo@tzi.org
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-cbor.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: cbor@ietf.org
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [Cbor] Re: Tag for Number as String?
List-Id: "Concise Binary Object Representation (CBOR)" <cbor.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/v-1D1TDanY2zr8XjV-ILDk4NbMk>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Owner: <mailto:cbor-owner@ietf.org>
List-Post: <mailto:cbor@ietf.org>
List-Subscribe: <mailto:cbor-join@ietf.org>
List-Unsubscribe: <mailto:cbor-leave@ietf.org>
On 28. Apr 2025, at 20:30, David E. Wheeler <david@justatheory.com> wrote:
>
> Ah, nice. But text, not a byte string, eh? That that there’s a difference for ascii, which I’m pretty sure is all that would be in the representation of a JSON number.
Both text and byte strings work here (and you could simply allow both).
Limiting this to byte strings is surprising, though, because most text turns up as text strings.
RFC 8259 says:
number = [ minus ] int [ frac ] [ exp ]
decimal-point = %x2E ; .
digit1-9 = %x31-39 ; 1-9
e = %x65 / %x45 ; e E
exp = e [ minus / plus ] 1*DIGIT
frac = decimal-point 1*DIGIT
int = zero / ( digit1-9 *DIGIT )
minus = %x2D ; -
plus = %x2B ; +
zero = %x30 ; 0
Not sure whether the " key was broken on the author’s laptop; in readable form this would be:
number = [ "-" ] int [ frac ] [ exp ]
int = "0" / ( digit1-9 *DIGIT )
frac = "." 1*DIGIT
exp = "E" [ "-" / "+" ] 1*DIGIT
digit1-9 = %x31-39 ; 1-9
DIGIT = %x30-39 ; 0-9
Grüße, Carsten
- [Cbor] Tag for Number as String? David E. Wheeler
- [Cbor] Re: Tag for Number as String? Carsten Bormann
- [Cbor] Re: Tag for Number as String? David E. Wheeler
- [Cbor] Re: Tag for Number as String? David E. Wheeler
- [Cbor] Re: Tag for Number as String? David E. Wheeler
- [Cbor] Re: Tag for Number as String? David E. Wheeler
- [Cbor] Re: Tag for Number as String? Carsten Bormann
- [Cbor] Re: Tag for Number as String? David E. Wheeler
- [Cbor] Re: Tag for Number as String? Carsten Bormann
- [Cbor] Re: Tag for Number as String? David E. Wheeler
- [Cbor] Re: Tag for Number as String? Carsten Bormann
- [Cbor] Re: Tag for Number as String? David E. Wheeler
- [Cbor] Re: Tag for Number as String? David E. Wheeler
- [Cbor] Re: Tag for Number as String? Carsten Bormann
- [Cbor] Re: Tag for Number as String? David E. Wheeler