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 [94.130.110.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id D7E2F1F451 for ; Thu, 11 Jan 2024 10:26:23 +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=pHjbKrcs; 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=PCS0qf21; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id F28A081D4C; Thu, 11 Jan 2024 10:26:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1704968772; bh=qnh4p2pGOUOvobNwUxuKMmVQwcxwjAOsSNp7fHgbpKY=; 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=pHjbKrcsEbCw2vVLGCFp+z+28i7NN5HrzN8LxedYV2DoidgfnTjThjFixkAcdinN6 LDy3TowPWT6jxGKm1Z2Wy/lEMFF4e5hT6J6ExiJC86cBvWB0UkVRxAHd+qbBdbkpCr y1zaBqv9pmb22TNNwfUHdORuUn/QekVX2iC8Prsg= Received: from wrqvtvvn.outbound-mail.sendgrid.net (wrqvtvvn.outbound-mail.sendgrid.net [149.72.120.130]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 005F281D37 for ; Thu, 11 Jan 2024 10:26:08 +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=PCS0qf21; 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=ZlA8JO0xBXP+3k3YkL57GjYJVsZEIUzvKhWNFTaycfs=; b=PCS0qf21zmQeZ3M83QsuJVO4Lvqm+O0ixW/B0SuA0a6C1GXYcCISKL/lDW5Ma9HHvaqI IQSW3n2FQ6RfWSPG03OxEC2+cRaF70oMDbiWviz0vBLyNhsM2IsZRht6vAu6aAjd/vn73N HB2WvXYk4RER/dbjUbDkrZ7Cto6lGKm8MZLRCxP9n2bNFQC5swOtlwR/xiTKvYKohddgGm nbZNKY+AWFpx0vTNR6OkNDtf+Vf7h91o6oWxCLZmExrTw41mIaklsBXkUU5HT12W9Cpq9y H3ZyIYvvFYe7pqjkpWJ/jA5az9I37UH/LP3NQa353p8M48JSkmMgkV4oQBoFjGQQ== Received: by filterdrecv-5bbdbb56cd-h9hcp with SMTP id filterdrecv-5bbdbb56cd-h9hcp-1-659FC23F-1A 2024-01-11 10:26:07.639123435 +0000 UTC m=+2658176.641362023 Received: from herokuapp.com (unknown) by geopod-ismtpd-8 (SG) with ESMTP id 7oALElJJRWGdc_Ul5XAcmw for ; Thu, 11 Jan 2024 10:26:07.601 +0000 (UTC) Date: Thu, 11 Jan 2024 10:26:07 +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: Eregon 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: 92733 X-SG-EID: =?us-ascii?Q?DvL3W2Xo+Vk=2FeUn3F50L=2FNc8u9NqZCnbE0mXZHiyye4R1YZg=2FtAFc0SAFzpcS=2F?= =?us-ascii?Q?Zcr7BqPN=2FYCcMZBMITNeIci9STxYay0JAJWPbek?= =?us-ascii?Q?rFR+qVDP7T3SyPdb8jbnERcxYWZNtn6Itw922l2?= =?us-ascii?Q?kYN6EnpvSgafc3ORPIHckbijHdk4Ek7HKG62RH2?= =?us-ascii?Q?FOrYv420OtncRWnWjySfmBPao0mVf57HDYuUftw?= =?us-ascii?Q?a7EgYhvO8QoTOM4tcFjLSmGg5lEs3ZFy51NZS1v?= =?us-ascii?Q?gBOZq17B1CqRmy9FvzIXw=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== Message-ID-Hash: 4NF5WCFNRQZGGFZZYKP5LZGZ2BYONZSW X-Message-ID-Hash: 4NF5WCFNRQZGGFZZYKP5LZGZ2BYONZSW 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:116170] [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: "Eregon (Benoit Daloze) via ruby-core" Cc: "Eregon (Benoit Daloze)" Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Issue #18576 has been updated by Eregon (Benoit Daloze). @naruse Do you have evidence of (latest release and not ancient) gems or ap= plications comparing `encoding.name` to `'ASCII-8BIT'`? I think it's so obviously a bad idea to compare the encoding name as a Stri= ng, AFAIK there was never a valid reason to use it (over `enc =3D=3D Encodi= ng::BINARY`, which works since Ruby 1.9) and it's inefficient, brittle and = unnecessary. FWIW https://github.com/search?q=3D%22name+%3D%3D+%27ASCII-8BIT%27%22&type= =3Dcode&p=3D1 shows very few matches and it's mostly copies of old VCR code. The chance of that code running on Ruby 3.4+ seems almost nonexistent, ther= e would likely be many more serious compatibility issues with such old code= (e.g. kwargs changes). And fixing it is really easy. @matz Can we experiment for 3.4? If we have pushback based on actual code then let's go more conservative, b= ut otherwise I think we should do the clean fix here. ---------------------------------------- Feature #18576: Rename `ASCII-8BIT` encoding to `BINARY` https://bugs.ruby-lang.org/issues/18576#change-106183 * 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/