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 E3F251F4C1 for ; Fri, 29 Nov 2024 16:36:07 +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=yHYtPPui; 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=M8pl7vjt; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1732898165; bh=oxyDSaTkA6GR3jI0i1Mfqul0Y3DfdQJyiSoOwaoGzjs=; 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=yHYtPPuiu8LPN0jND2hw2qe7LNGG16gywpd8+GLmjs79UQyImW2q+SVoLTg/loHEc mw/cFfUrWId45DWVNCWZuiZ8j7syKZ/9jBdRW1n9pt62EVY1H5iNXvylCyklZbC1M1 k2bRSGte9UX/BII6gxgNz+hj4uPN+xxE1HtPEUR8= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 4E39344C9B for ; Fri, 29 Nov 2024 16:36:05 +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=M8pl7vjt; dkim-atps=neutral Received: from s.wrqvtzvf.outbound-mail.sendgrid.net (s.wrqvtzvf.outbound-mail.sendgrid.net [149.72.126.143]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 4207744C2D for ; Fri, 29 Nov 2024 16:35:54 +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=cJ9dhyDHIFtNDu1TAkiuWNDshJkqPAHz28/rQOEugeM=; b=M8pl7vjtXGSgzgm20f4SMkgX4/fapXjULn5Snx4wSnDjvEUmjT2vEYN4xY5cJ0982GdX kI0YOv+XWGIkzeC0W4CSzlWOBumOZaJnangWueFQIkoscv8gBSvalEHqL/DcWWpPLGdH2Z F3ZGtuseUjArzExIhxeS0D4pmcyk4bXNHIfLvFr+qilmrRoXehjgxiCb49yOafom8ZvuCM Ufn1GP97gy+6jNR/cZyBPSDsmew86U2EPA91dv89yJJ2/KMhHzIwjV1rwn91GgwFSRAeqj xGz9g2r3DLfCMcBEuO6Euk8PbLYfC25YLO0+uzIfCPfXCiW/nHpDgAIuPabKOO/w== Received: by recvd-69cbc48b94-ftnkf with SMTP id recvd-69cbc48b94-ftnkf-1-6749ED69-4 2024-11-29 16:35:53.113657806 +0000 UTC m=+1278839.765875836 Received: from herokuapp.com (unknown) by geopod-ismtpd-7 (SG) with ESMTP id noSqCRqyQ0GcBbWoHzE7iA for ; Fri, 29 Nov 2024 16:35:53.096 +0000 (UTC) Date: Fri, 29 Nov 2024 16:35:53 +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: javanthropus 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: 96735 X-SG-EID: =?us-ascii?Q?u001=2ErGSxngKD6oGl9tWadX4XoV3etLquOoKg0CfRIgtn0=2F=2F51X16iSgr7Y8Wy?= =?us-ascii?Q?1fjCWEM5G6QT6lpC2QanJ2tFrap9W5zaCqDWGhY?= =?us-ascii?Q?=2F96ZJYC5KNRzbDUi3VzzrD1rKe+gqQz1SO6mheV?= =?us-ascii?Q?sWTdX7ZzdRXmBxSUiNUFz9A2aTG+x3=2FPlVHpABr?= =?us-ascii?Q?giY2pDXAB3upDcTyZijfJvlk0p0nryqJpqbb42z?= =?us-ascii?Q?7TcEHb5hHRFtj95LbKkLDE6T5UAQcekGYqj47wu?= =?us-ascii?Q?OgUFPOdoUfItN1NTXt1mJAf3ZQ=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: HO4TITVRVFTNPNX4M4YNXCUFHIVLFCDB X-Message-ID-Hash: HO4TITVRVFTNPNX4M4YNXCUFHIVLFCDB 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:120059] [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: "javanthropus (Jeremy Bopp) via ruby-core" Cc: "javanthropus (Jeremy Bopp)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20924 has been updated by javanthropus (Jeremy Bopp). Note that replacing `#readline` with `#gets` in the examples causes the issue to be seen in all Ruby versions, including 3.3.6. ---------------------------------------- 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-110797 * Author: javanthropus (Jeremy Bopp) * Status: Open * ruby -v: ruby 3.4.0dev (2024-11-28T12:38:16Z master 3af1a04741) +PRISM [x86_64-linux] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- ```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/