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 AD8FB1F44D for ; Mon, 19 Feb 2024 23:24:10 +0000 (UTC) Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 0C59582AB7; Mon, 19 Feb 2024 23:24:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1708385042; bh=W/XXJURNxHsZnnm+8r/ntqKCH5jKj40HKCpkCEA87E4=; 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=1cFH/s+L9ZH5japNva0y+IbsivEe7Qb7u8XGOzM6F+LCfB/G+Ru4OXjNKL2p5FSeE aA1PRxv6uhSwDpdlZ1FHFlbes0+Xa24Z6CsSecYN+7om4QlNJWzgsLx989cHWpSu8/ S1DqdISIM45j0DR32TNKxe7khLhCT15WRvETiUwI= Received: from wrqvtvvn.outbound-mail.sendgrid.net (wrqvtvvn.outbound-mail.sendgrid.net [149.72.120.130]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 34BF9829FF for ; Mon, 19 Feb 2024 23:23:58 +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=lIXmxIfB; 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=0FEvtuyBC3QAb7zQKIBZma96k93tBt1z9JDAXLF5XRA=; b=lIXmxIfB1t2XORtC50TQSbKyx1ieEnc3f0vMlchwMyEuqZTJvxLCZYQ0mtcn/0dYNWLe gDzSDXLlw6CnNkd+pMg4s/keGv8ZURfCbDbAZKMMLBeafrriAjAH8VrTOJG8pwMNabIFlt j4FiM0PulrtUxBQJDXf+rXfgCTmbqUQC92YK9ZB4UxTW1dRH2qXU3SmSlxYDMeCqpmDR0H ifqEolMyQDs3hFi6i6LUOSe116KTetDVNPiun9frOuXbRanu4aekzu7WGrbPpBaqOBkEwa raDsj/C+G2vSn8cDyoiPdmKkKd/EzcJKkkrygSYWp3xvfjP2nZjBXz0gQ3uVKkfQ== Received: by filterdrecv-58bfc74dd6-gwqf5 with SMTP id filterdrecv-58bfc74dd6-gwqf5-1-65D3E30D-1 2024-02-19 23:23:57.054015836 +0000 UTC m=+2192830.617880869 Received: from herokuapp.com (unknown) by geopod-ismtpd-5 (SG) with ESMTP id 4bFGI4qgTrGh_YMfUfkswQ for ; Mon, 19 Feb 2024 23:23:56.998 +0000 (UTC) Date: Mon, 19 Feb 2024 23:23:57 +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: duerst 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: 93413 X-SG-EID: =?us-ascii?Q?sZFLhNnqjcW9Ht8ByfkgOQbWPVETXXFxLuf0UPwpQ=2FbXrx066LnwciY0taRhC1?= =?us-ascii?Q?++A6DTJJ4lt=2FzJkwBQUmmbJXhB+C4nQ033MjSGj?= =?us-ascii?Q?je1hQt90EOI2U7uplzf4uIHGqd8uaBokVyVLIew?= =?us-ascii?Q?7NNLtubqj1+6sQdZGAPbrC4QcaWsMhRXGhgL3rT?= =?us-ascii?Q?KfuapNSDrFZT3l+0+nxwWOL1JQeCBCK1LKS6NC2?= =?us-ascii?Q?Hb5z3cMI8JpHbwMzzCZGhpBkdyk1cyjV1gZJ87u?= =?us-ascii?Q?UBITQlK10MtkWodJFwgGg=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== Message-ID-Hash: OSKZKDDAPZ7YEZHCMREVPDYQOWKJYSS3 X-Message-ID-Hash: OSKZKDDAPZ7YEZHCMREVPDYQOWKJYSS3 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:116857] [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: duerst via ruby-core Cc: duerst Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Issue #18576 has been updated by duerst (Martin D=FCrst). What about ``` >> "f=E9e" + "f=E9e".b (irb):8:in `+': incompatible character encodings: UTF-8 and BINARY (ASCII-8= BIT) (Encoding::CompatibilityError) ``` This still leaves "ASCII-8BIT" in (because I think it's important to help p= eople understand that BINARY and ASCII-8BIT are the same). [It also keeps the wart of consecutive parentheticals, but that can be deal= t with separately.] ---------------------------------------- Feature #18576: Rename `ASCII-8BIT` encoding to `BINARY` https://bugs.ruby-lang.org/issues/18576#change-106889 * 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/