[Cbor] EDN - carriage returns

Joe Hildebrand <hildjj@cursive.net> Thu, 22 August 2024 17:27 UTC

Return-Path: <hildjj@cursive.net>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id EEA27C151534 for <cbor@ietfa.amsl.com>; Thu, 22 Aug 2024 10:27:31 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.106
X-Spam-Level:
X-Spam-Status: No, score=-2.106 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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 (1024-bit key) header.d=cursive.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 d21FUfImrbhK for <cbor@ietfa.amsl.com>; Thu, 22 Aug 2024 10:27:27 -0700 (PDT)
Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id F0305C15152B for <cbor@ietf.org>; Thu, 22 Aug 2024 10:27:27 -0700 (PDT)
Received: by mail-il1-x136.google.com with SMTP id e9e14a558f8ab-39b06af1974so4229235ab.2 for <cbor@ietf.org>; Thu, 22 Aug 2024 10:27:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cursive.net; s=google; t=1724347647; x=1724952447; darn=ietf.org; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:from:to:cc:subject:date:message-id:reply-to; bh=BHUMT4L8cqNAlnIURV543IO4Rb83kIOLDBmPRL3iQCI=; b=BazF64oEZ5GoTqXkLs6o0UggexgftsG+ZCkqGEDe5Ikq7Os57jy/82eDWMRdhqAA+P FinqgvnGwTJ2P9a338QK0wsxkSBXiFxV18razMgA8omX31VbqGc5Z0j/pu3/+u/BWZRc zQ0GENVBHWDCnMa7RqTbLjWfR+1RSTHso0XuA=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724347647; x=1724952447; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BHUMT4L8cqNAlnIURV543IO4Rb83kIOLDBmPRL3iQCI=; b=f+XfTU6bU7O+bXyIn64Ksf7kHrTnQlI5MY8rS3B3Yae593q18jy3w/y385GcE6i8Zm JwAtqIWxBLxcudIbz5oXp0WEc5LJiGqSbuOrwd58hUAE9/5u6PsElCWvsM3/6DP51y4b //9stbH1xZpDEPfyBl6Qv0NuIz2DRNgTMuxrJGpeUX4DaGL65nKr0f3KVWvd+bV6jD/j VvTCF2yoON1NF1AkRqsGCzXbsJ+gV5JP0AOaMQ1Yz1+AX3YWWqYoBXABnrQmc6xfC715 6wO1Ly9cfLvsKeCiPWhnoHjNuyQwarUDltB8t3dPp3O5PQSxnhROPQHhTLsOdUscbaTK Pj2Q==
X-Gm-Message-State: AOJu0Yzlyy4QLj/tzU+RTEcibmKmnnMhMuPfxngAjN3kpnSmwXWwHnyg SzIrolp01D0NXjbJ+Oiy7ZDexRolcEds+FSy7uHZOAGXJhpjI95zVdkQYFPVFfL0JurwWJG2zks =
X-Google-Smtp-Source: AGHT+IEVX79RrjQzmlWCLABB0lP2WltJUME1eymyFZz/17yxuFGe9pHfMJJCcHWpASeUDL2UMdCS+w==
X-Received: by 2002:a05:6e02:1c2b:b0:37a:6c26:66dd with SMTP id e9e14a558f8ab-39d6c2cb82fmr76839285ab.0.1724347646561; Thu, 22 Aug 2024 10:27:26 -0700 (PDT)
Received: from smtpclient.apple ([2601:282:2181:450f:6890:e34:d35c:aba2]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-39d73e74705sm7850855ab.22.2024.08.22.10.27.26 for <cbor@ietf.org> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Aug 2024 10:27:26 -0700 (PDT)
From: Joe Hildebrand <hildjj@cursive.net>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\))
Message-Id: <A387DD1E-A5C5-4B34-9A6E-E2C0EE8B1E70@cursive.net>
Date: Thu, 22 Aug 2024 11:27:15 -0600
To: CBOR <cbor@ietf.org>
X-Mailer: Apple Mail (2.3776.700.51)
Message-ID-Hash: CYXYSM33HM4A3L5I3IMKSBXVQBRUYRPO
X-Message-ID-Hash: CYXYSM33HM4A3L5I3IMKSBXVQBRUYRPO
X-MailFrom: hildjj@cursive.net
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
X-Mailman-Version: 3.3.9rc4
Precedence: list
Subject: [Cbor] EDN - carriage returns
List-Id: "Concise Binary Object Representation (CBOR)" <cbor.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/lo-gJoXLEySth1YkQXIeDtAMTgU>
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>

The grammar in -11 says:

    unescaped       = %x0A ; new line
                    / %x0D ; carriage return -- ignored on input

I agree that "\r" should be ignored in input.  I hope that Mac-style "\r"-only line terminators are not in enough use to matter anymore.  Could we please add some normative text that describes this behavior and the trade-offs?

For example, after "The following additional items should help in the interpretation:"

- Unescaped uses of CARRIAGE RETURN (U+000D, also often seen as "\r" in many programming languages) that exist in the input should be ignored as if they were not in the input wherever they appear.  This is most important when they are found in tstr or bstr contexts (see the "unescaped" ABNF rule).  On some operating systems, a carriage return is always paired with a LINE FEED (U+000A, also often seen as "\n" in many programming languages), but in other operating systems, they are not used.  The intent behind this approach is to ensure that input generated on either of these kinds of operating systems will generate the same CBOR bytes.  Operating systems that use only LINE FEED are no longer relevant and the files they produce are out of scope for this document.

— 
Joe Hildebrand