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 3377D1F451 for ; Wed, 17 Jan 2024 08:36:46 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=s9I4W6o0; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=q40QpkHw; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 13BAD81DFF; Wed, 17 Jan 2024 08:36:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1705480598; bh=aEDrHsDR8K5yFlsXPARIxOreTUgfSIIFUyixt7Xn6/U=; 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=s9I4W6o0su1cF/ELQysmP344GwldlNUWPacmlgomIgmoOXSfjQaSvM5BRMEfJlixI S1Sgw3AXjhIas05xoMfFweGSU0m5iFzuPjHKZSPiXU7FW804sEgv0u8MttyvVnIShA Z+7tc5PrxFLKQwdb1atzJuqIxgKDVvniVlTNAicA= Received: from wrqvtvvn.outbound-mail.sendgrid.net (wrqvtvvn.outbound-mail.sendgrid.net [149.72.120.130]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 9EF5181DF7 for ; Wed, 17 Jan 2024 08:36:34 +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=q40QpkHw; 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=GTN5a5cnI7fgVQcug7CpEEgtnSKd6iokVfg1Yb3jnpc=; b=q40QpkHwXi3R0I87+FwW+QeEjtxp/o2fO7ENOy37koO37E884kG4peYCtMLHuk4rRq87 7EG7xfxfSsADesOHcvK6SQ41I/72uszrSk9lKvant/qRfEbOZliMrw/9vVcLEJeOFZKbHS cAJ4WNOFxf4wgGogzkQCuDaeHsioOXELy2q7kDeAPw9swQCi6e+FA2IOgQIDYw+OLtVvnX npcFh1wY50x2khgdP0C6wfiAHLFcFGeSM/WD7fPo4QbIyIDRl92vCXFuyorDJlcUXAkXO8 d8jJK0ilU6IRE958635ltau9w/p1k71UR0z+Ban/vmIMXYixtR/IuI9no3UicONA== Received: by filterdrecv-6b68c9f446-plpwr with SMTP id filterdrecv-6b68c9f446-plpwr-1-65A79191-15 2024-01-17 08:36:33.424536241 +0000 UTC m=+7912535.337369861 Received: from herokuapp.com (unknown) by geopod-ismtpd-5 (SG) with ESMTP id -7tcvTAqS5im_sR2CLKG1g for ; Wed, 17 Jan 2024 08:36:33.371 +0000 (UTC) Date: Wed, 17 Jan 2024 08:36:33 +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: byroot 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: 92830 X-SG-EID: =?us-ascii?Q?Dq8GNIcVqP8cs5uR+EIAabfg3LE9XdC6dZ5KYNrMpf6VzBWG6HqArcu5raQjXL?= =?us-ascii?Q?IGTFdxKHUt7++67+KD54pNYXheirMcsUIf3sdgF?= =?us-ascii?Q?Riq06gSsM6OfAppC2z5+2mqzStCujuQdR3yvoPg?= =?us-ascii?Q?5VtW9cmakJaZ=2Ff+Jx8hfHjW3VVnxul8IBmRWktm?= =?us-ascii?Q?NqOoH1U4+JHNTD=2FYmFEUdF76pLih1JOw=2F4XRMbv?= =?us-ascii?Q?JeZe+EElyJ7JNYwVAFXgOkZc9HtAHAqj=2FLMFWs9?= =?us-ascii?Q?tTjroZb2mW11rQsZnfNbA=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== Message-ID-Hash: BSN3P5FMSHXF4W4ATTTV6KMLPCJ25Q7V X-Message-ID-Hash: BSN3P5FMSHXF4W4ATTTV6KMLPCJ25Q7V 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:116268] [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: "byroot (Jean Boussier) via ruby-core" Cc: "byroot (Jean Boussier)" Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Issue #18576 has been updated by byroot (Jean Boussier). @naruse no one is denying that there is private code out there that will be= broken by such change. The question is how much and how hard it would be t= o detect and fix, and how much the change improve Ruby for its users. We regularly make changes with much more breaking potential. So that alone = isn't a reason to refuse the change in my opinion. But if there is consensus that the cost/benefit isn't positive, then I'd li= ke to propose again: > We could keep Encoding#name as "ASCII-8BIT", but change Encoding#inspect = and make sure EncodingError use the BINARY name in its error messages. But slightly modified: I'd like to change `Encoding::BINARY.inspect` from `"#= "` to `"#"`. Would that be acceptable? ---------------------------------------- Feature #18576: Rename `ASCII-8BIT` encoding to `BINARY` https://bugs.ruby-lang.org/issues/18576#change-106290 * 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/