From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Received: from nue.mailmanlists.eu (nue.mailmanlists.eu [IPv6:2a01:4f8:1c0c:6b10::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id AE3BD1F44D for ; Mon, 19 Feb 2024 23:03:11 +0000 (UTC) Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id D399082AD7; Mon, 19 Feb 2024 23:03:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1708383783; bh=+XiKlUk7oKzZg7/RWv6azSbWFbhM4pdta/a9Bvx8wLo=; h=Date:References:To:Reply-To:Subject:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Cc:From; b=by96DA04okmetmtwCa0ucdDsPDAW+NjNwArDbjaq8PmmeoE6J+n7etXFwHd0BzMse JqUqTdo4lwPGxarlejidUQnAxtuelrWetkgfEZFP0izZzNIFGLdwv6Gko1HHIh2ypQ 9iz3fXQx3M7dcVA1SYsdNmFVoP3FiEpw4ZqbANnA= Received: from s.csnrwnwx.outbound-mail.sendgrid.net (s.csnrwnwx.outbound-mail.sendgrid.net [198.37.146.154]) by nue.mailmanlists.eu (Postfix) with ESMTPS id CA85682AD4 for ; Mon, 19 Feb 2024 23:02:57 +0000 (UTC) Authentication-Results: nue.mailmanlists.eu; dkim=pass (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=QEENatVg; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ruby-lang.org; h=from:references:subject:mime-version:content-type: content-transfer-encoding:list-id:to:cc:content-type:from:subject:to; s=s1; bh=pn8zLE8CKizlwGpTlNT2c0LwP/Mv1uG2bMKXxAEBalo=; b=QEENatVgHqVNG7ts9ox6Za0XcKOHuXPHX9LJWNP58LwbYk6tMQhzifBbtGhxdHf6GFt4 rrtJacD9QxDFL5rsT8HGBq3gz+Y9dxxReBjR2o0G+a0aHa44NPmFjwX1lwuq79SXjqM8bo WVAtbqDQfybWyWBKr8nDT1v+1wuMGNmoMGkGt1+VoXH7QjH1y3isNoo57HR9/WnHLMfxVI RcnTHjZfpjug4zBaBbK66GQvgifM4rj/XTCVDMcYthARS9nd1h7Ab9x9SR5ity4rV6E3iA YvFa+lsrYbYqs0QCb45rcC9kNPCQy3LfavepMZuwhFfmoHzMcp6GARYin8d02kvg== Received: by filterdrecv-655bd866f5-x7rtn with SMTP id filterdrecv-655bd866f5-x7rtn-1-65D3DE1F-4C 2024-02-19 23:02:55.786556151 +0000 UTC m=+960380.180647606 Received: from herokuapp.com (unknown) by geopod-ismtpd-12 (SG) with ESMTP id jvzf9p56QwyycqundBnQJw for ; Mon, 19 Feb 2024 23:02:55.747 +0000 (UTC) Date: Mon, 19 Feb 2024 23:02:55 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Feature X-Redmine-Issue-Id: 18576 X-Redmine-Issue-Author: byroot X-Redmine-Sender: Dan0042 X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-Redmine-MailingListIntegration-Message-Ids: 93411 X-SG-EID: =?us-ascii?Q?9vnO9kNFlf1pwhty1clU3mt9eNWYniufdXqocdsQQtaDTWZk4+b5g5js0Akvaj?= =?us-ascii?Q?32LW=2F+fGSAom3tt8Jo+=2FGW3uDD0ktbmu7qAbln0?= =?us-ascii?Q?uJrjIDNoP7vlgJ97hbNTUl1K2MC5xEyIGUWATZ+?= =?us-ascii?Q?oGdUJQ1fNEWc5Vj7dKcl5TeBLfJmcFubTIT8H0L?= =?us-ascii?Q?=2Fz79w6WWSgpnaCwcnjzSZFqhMKA2JMG6riJF+Rp?= =?us-ascii?Q?Pt3myEM5PpLKLZ0B6l1BDSdHmd6RW9xa99b4vwu?= =?us-ascii?Q?Zst6LfecAgVxOeZ9OKj+A=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== Message-ID-Hash: M7GWUW6HSBAJZYHWDOJFRSPZJCPGH5TP X-Message-ID-Hash: M7GWUW6HSBAJZYHWDOJFRSPZJCPGH5TP X-MailFrom: bounces+313651-b711-ruby-core=ml.ruby-lang.org@em5188.ruby-lang.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:116855] [Ruby master Feature#18576] Rename `ASCII-8BIT` encoding to `BINARY` List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "Dan0042 (Daniel DeLorme) via ruby-core" Cc: "Dan0042 (Daniel DeLorme)" Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Issue #18576 has been updated by Dan0042 (Daniel DeLorme). I've come to realize something; when an ASCII-8BIT string contains only asc= ii characters, it behaves exactly like a US-ASCII string and in such a case= it feels unnatural to call it "binary" (at least for me). But as soon as t= here is a non-ascii byte, it becomes incompatible with every other encoding= and then truly deserves to be called BINARY. And that's when encoding erro= rs occur. So in error messages, "BINARY" makes perfect sense to me since th= e error occurs due to the string being in "binary" state rather than "ascii= -only" state. The distinction may be irrelevant to others but at least it h= as helped me put into words and understand why it felt so uncomfortable to = change the name to "BINARY". Just my 2=A2 ---------------------------------------- Feature #18576: Rename `ASCII-8BIT` encoding to `BINARY` https://bugs.ruby-lang.org/issues/18576#change-106887 * Author: byroot (Jean Boussier) * Status: Open * Priority: Normal * Target version: 3.4 ---------------------------------------- ### Context I'm now used to it, but something that confused me for years was errors suc= h as: ```ruby >> "f=E9e" + "\xFF".b (irb):3:in `+': incompatible character encodings: UTF-8 and ASCII-8BIT (Enc= oding::CompatibilityError) ``` When you aren't that familiar with Ruby, it's really not evident that `ASCI= I-8BIT` basically means "no encoding" or "binary". And even when you know it, if you don't read carefully it's very easily con= fused with `US-ASCII`. The `Encoding::BINARY` alias is much more telling IMHO. ### Proposal Since `Encoding::ASCII_8BIT` has been aliased as `Encoding::BINARY` for yea= rs, I think renaming it to `BINARY` and then making asking `ASCII_8BIT` the= alias would significantly improve usability without backward compatibility= concerns. The only concern I could see would be the consistency with a handful of C A= PI functions: - `rb_encoding *rb_ascii8bit_encoding(void)` - `int rb_ascii8bit_encindex(void)` - `VALUE rb_io_ascii8bit_binmode(VALUE io)` But that's for much more advanced users, so I don't think it's much of a co= ncern. --=20 https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-c= ore.ml.ruby-lang.org/