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=0.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET,SPF_HELO_PASS, SPF_PASS autolearn=no 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)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 6B91B1F4CC for ; Wed, 15 Jan 2025 01:54:40 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; unprotected) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=UKAkGnsX; 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=FUd2S7QO; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1736906047; bh=QrIxNxbTLSklaNYGaR5kySuimLDRDMmheK6gp7FH9tg=; 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=UKAkGnsX3WPeIwO6La9ukEnlpu1bv8ZfLC2YYHZweuS9vdBbbpNUOg2eHF5JSc5Eb 2PtM8zKC4I4teW3DnEjs6Ayzb7QX25eMlZsl/7LXfk8QQOXptTKrDqxv1AumcQhtcm QejpcEfxj0tWNbTANj8S0Jfet6JLRvPYBvkiJLRI= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 3D92346C23 for ; Wed, 15 Jan 2025 01:54:07 +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=FUd2S7QO; dkim-atps=neutral Received: from s.wrqvwxzv.outbound-mail.sendgrid.net (s.wrqvwxzv.outbound-mail.sendgrid.net [149.72.154.232]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 3EA434701D for ; Wed, 15 Jan 2025 01:53:50 +0000 (UTC) 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=yMNCDiAd8EKX8YExA3zwQZSix7gzwape6KtN/bXGSxE=; b=FUd2S7QOaJhdJYxp8CX42+0aNXteIrsv0CsZX1BwPY6Mfe0zC5s3zaCgmz1vPsgLhFBY zF7xugkKI2EL8wpIuOmuAyW7mjEP3Jd/D6BXActwPpZlG7Xxe1DspKuZfIe3CMNsPt6coE TU7RuOKwVuNrxfbgXO5i+e/WdiNNt+g2oh1lrFLZ41MH2XOgTsS9bdt3drXKJl9sy29OZD DAZeyyfu9pk+QLs8grjZH7NZM5eBVP53sSXxPpjuw7el4vG+9lg9TYb0R1brfmv+z/Ue36 i/OsQWc3T+Zn/wI2OJuLyvztNZ7lWz9Qajc0YdvVS5dJl+hdx4rWXa7B4TnP7wlA== Received: by recvd-84b546689d-997dv with SMTP id recvd-84b546689d-997dv-1-6787152B-1 2025-01-15 01:53:47.049678091 +0000 UTC m=+5286688.515013581 Received: from herokuapp.com (unknown) by geopod-ismtpd-13 (SG) with ESMTP id 3UPxB1FtRQK2wwz7lhvK7Q for ; Wed, 15 Jan 2025 01:53:46.893 +0000 (UTC) Date: Wed, 15 Jan 2025 01:53:48 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 20924 X-Redmine-Issue-Author: javanthropus X-Redmine-Issue-Priority: Normal X-Redmine-Sender: k0kubun 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: 97372 X-SG-EID: =?us-ascii?Q?u001=2EsWSpkbcla4bB6tSlkOwdN01=2FLLwMflJlYDs0Ak3Gg6dwg4YUERnU2ZQsI?= =?us-ascii?Q?KPesnHmuO3R4nEnLV41FQje7rMJs=2FlByQKQxPtJ?= =?us-ascii?Q?4AIt7Pq58gDL0FXTadgeAG3rd7U5C71dqgQykj7?= =?us-ascii?Q?aTStEoA7ejF3H5RHy5N+wZUdManRe0Z74E3GVBz?= =?us-ascii?Q?CZdIbCT3PvP0lonSvPNjyWRsQ04knsbrr0UFj0z?= =?us-ascii?Q?hWnE7L+KnCQYPhbprPYqihQ40Bbc7KL=2F5c0RSKk?= =?us-ascii?Q?N+i54Nc0l5oR8lTaf72q0zfc+w=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: 6KM2TYH3TBV3ITMIDXBMYFJDP5CXDQ5E X-Message-ID-Hash: 6KM2TYH3TBV3ITMIDXBMYFJDP5CXDQ5E 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.9 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:120686] [Ruby master Bug#20924] IO#readline ignores the limit argument when the encoding is UTF-32LE and the limit would split a character List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "k0kubun (Takashi Kokubun) via ruby-core" Cc: "k0kubun (Takashi Kokubun)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20924 has been updated by k0kubun (Takashi Kokubun). Backport changed from 3.1: REQUIRED, 3.2: DONE, 3.3: REQUIRED to 3.1: REQUIRED, 3.2: DONE, 3.3: DONE ruby_3_3 commit:00147cbab567b05b8a4137875bbda341ef704760 merged revision(s) commit:e90b447655dd39ad1eb645cdaae450efd605db00. ---------------------------------------- Bug #20924: IO#readline ignores the limit argument when the encoding is UTF-32LE and the limit would split a character https://bugs.ruby-lang.org/issues/20924#change-111509 * Author: javanthropus (Jeremy Bopp) * Status: Closed * ruby -v: ruby 3.4.0dev (2024-11-28T12:38:16Z master 3af1a04741) +PRISM [x86_64-linux] * Backport: 3.1: REQUIRED, 3.2: DONE, 3.3: DONE ---------------------------------------- ```ruby require 'tempfile' Tempfile.open(binmode: true, encoding: 'utf-32le') do |f| f.write('0123456789') f.rewind # A limit that would truncate a character becomes completely ignored f.readline(3).bytesize # => 40; should be 4 end Tempfile.open(binmode: true, encoding: 'utf-32le') do |f| f.write('0123456789') f.rewind # A limit on character boundaries is respected f.readline(4).bytesize # => 4 end Tempfile.open(encoding: 'utf-8:utf-32le') do |f| f.write('0123456789') f.rewind # A limit that would truncate a character becomes completely ignored f.readline(3).bytesize # => 40; should be 4 end Tempfile.open(encoding: 'utf-8:utf-32le') do |f| f.write('0123456789') f.rewind # A limit on character boundaries is respected f.readline(4).bytesize # => 4 end ``` This doesn't happen with UTF-32BE. This also doesn't happen in Ruby 3.3, but it does happen in 3.4-dev and Ruby 3.0 - 3.2. -- 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/lists/ruby-core.ml.ruby-lang.org/