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) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 530951F4CC for ; Sun, 15 Dec 2024 09:34:02 +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=mngYCTBg; 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=ii0o0cAb; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1734255209; bh=2o2SClFh3ciN8RBRhBknbdaHxafCDb7LPDsPVNpJRbE=; 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=mngYCTBgbQBXa7VQE4Iqq4Ama9fPKh7S8h3qgjfHzz7qyX2M5U7yZmoxrD0yPxHyT QzCEY3wcmv/nRyH7WlMf7+yF09sio6X/TIycJDJkP2+tchfbfR6V4s6EenBtqrU9sI pe1xgcoqAzfK0uTsGvjmS+oPwmWrBT+wuudSWkBc= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id ECECA44DDE for ; Sun, 15 Dec 2024 09:33:29 +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=ii0o0cAb; 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 0C43D44BA5 for ; Sun, 15 Dec 2024 09:33:15 +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=UzXvDe1aM6v675vKCJRMoup5eBzCy+cR8/sNL2KTHWs=; b=ii0o0cAbcH5pjx7XQDuZvDv+Eu92j/G41E5H0ap3IdlzqvMC+ckIzncLJZvQf6R/atyd G7VvmH7d299sbd1g3jCESlIplkt30s48voNrbAwBkYAwNXgQj1rPDACj9chGP+LXbHOJUY bpIJvO7HiXKKhteyvkitKqdEygzG9ouqnQ9bwIw5YRTr6Z1bryAOkSPGD0sFMU6lz7e26o Zen95r6hS9yV1M1lSgaLIWjJ0/dK3La+h1QLUw8rjozDkVgeP9OmNR0ZeFB2Hh27hyMs0L 6MAVEFhNk9BA/2g/zAOjT0nHayOMVfBQQgiOhan7kiLdzONJ+H6ClNwD+mAQ11xw== Received: by recvd-786d47b7ff-m4pj6 with SMTP id recvd-786d47b7ff-m4pj6-1-675EA25A-4 2024-12-15 09:33:14.087996833 +0000 UTC m=+2635759.219799819 Received: from herokuapp.com (unknown) by geopod-ismtpd-33 (SG) with ESMTP id r6nWlKfcT7Oapm2n4nMsiw for ; Sun, 15 Dec 2024 09:33:14.073 +0000 (UTC) Date: Sun, 15 Dec 2024 09:33:14 +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: nagachika 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: 96925 X-SG-EID: =?us-ascii?Q?u001=2E44VQVH0G4ktThU9FFZyDXb=2FoLGKi0xg3KhKXpO+IAEE5wRGZS=2FaUmrCxU?= =?us-ascii?Q?vRSr0kI+o91vm0PKZJNpskxVPGLEUY0z2=2FFYkjb?= =?us-ascii?Q?KjL91GsNRUC4Dh71nFhooG1A5dqKjj4ha2Yk7sP?= =?us-ascii?Q?fjrOG+QV3TDqhirFpoWY02PK+8v1AnC1P6xZWZr?= =?us-ascii?Q?lL6k5NgM0P9ckMWfWlMnVmCxfFWx9AxSjSlFQ6q?= =?us-ascii?Q?3UDofQjy23ArT4D5xufdeA79r3ObcWBE4vAdPPs?= =?us-ascii?Q?02M1O=2FcEVoYhID8yiSosOjCvjw=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: TSXSH2L2LO4HVGUOC7GWCCYR6FWHLUV7 X-Message-ID-Hash: TSXSH2L2LO4HVGUOC7GWCCYR6FWHLUV7 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:120248] [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: "nagachika (Tomoyuki Chikanaga) via ruby-core" Cc: "nagachika (Tomoyuki Chikanaga)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20924 has been updated by nagachika (Tomoyuki Chikanaga). Backport changed from 3.1: REQUIRED, 3.2: REQUIRED, 3.3: REQUIRED to 3.1: REQUIRED, 3.2: DONE, 3.3: REQUIRED ruby_3_2 commit:3110d5c8abf8f710de42989fbc35870287a12f75 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-111018 * 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: REQUIRED ---------------------------------------- ```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/