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 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)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 8FE8D1F4C1 for ; Fri, 29 Nov 2024 16:07:25 +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=WNTpHbqB; 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=N/wDr2hk; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1732896443; bh=xpaSPre3YDs4OdbKihNROUdQHF+sHkyFPuKQetPeqeg=; 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=WNTpHbqB9y1s0/yh6v8Lbx6Y8fxGA9mpx2lKGBBkOr9hm6NQDMLDdbPH0Vp3XWo94 CcpOVi+mK08kL0jwVYkoUy+qWlfynA2dUXbCvWfylBBwOjpm0iRdzS8gq4dnWF9gn9 qRjCACs5RixehoBvdPezWX5hZftOuezOzmxxT0O4= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 024B444CBD for ; Fri, 29 Nov 2024 16:07:23 +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=N/wDr2hk; dkim-atps=neutral Received: from s.wfbtzhsv.outbound-mail.sendgrid.net (s.wfbtzhsv.outbound-mail.sendgrid.net [159.183.224.104]) by nue.mailmanlists.eu (Postfix) with ESMTPS id AC57344C31 for ; Fri, 29 Nov 2024 16:07:10 +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=fqkUPTvZgeDpBw1buWS1P7/rCqnN3mfdXzWedtrUrrA=; b=N/wDr2hk5UcgJeFw5gPRcsnRZxtFkJHRqdOrj3kZ23oKQFlxQMJVl/FJA7tZmpV5A4cY rp4XrtnVxn2vngeBZUF2DT8ekkaLm7gqGWsklvxadPclGO0adcfkGazxd35UdPqEPniLau IM3j6KS0c5SNjyqcHlcRW+2olRd1c3CTEeloPrvvzND6gY3wNJXzQF9ICgilB1OUiwknUU uiNesVIhShaJet+YYglIcg+OABBQSyv85xDVdbxU+5dRWkXsngmxuEFC6KgLmq6tmTH07e X1i46Dr4YSPOQJstL9folKVh/Vk0UDVGv6hPj8APxinHfghG3cRheowbXza+3VqA== Received: by recvd-5f54b5d587-zdng7 with SMTP id recvd-5f54b5d587-zdng7-1-6749E6AD-D 2024-11-29 16:07:09.338572874 +0000 UTC m=+1276983.640480360 Received: from herokuapp.com (unknown) by geopod-ismtpd-65 (SG) with ESMTP id 5PphXHbUS8ymTEOHLHEdqg for ; Fri, 29 Nov 2024 16:07:09.275 +0000 (UTC) Date: Fri, 29 Nov 2024 16:07:09 +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: 96734 X-SG-EID: =?us-ascii?Q?u001=2ErGSxngKD6oGl9tWadX4XoV3etLquOoKg0CfRIgtn0=2F=2F51X16iSgr7Y8Wy?= =?us-ascii?Q?1fjCWEM5G6QT6lpC2QanJ2tFrap9W5zaCqDWGhY?= =?us-ascii?Q?=2F96ZJYC5KNQtMxkq+VAmAryfxDaUmk1ao40Ppga?= =?us-ascii?Q?6dbokQKnjVMpsuNbqLok7Hbq1io4drbCBECpL8c?= =?us-ascii?Q?sTTEB0tuQV=2FySigi1Gc75V2tPsYxR+f4nHbRJLV?= =?us-ascii?Q?fU8IVIPWE8azfSUizlAundE0FyzNiKf0aD05Hc8?= =?us-ascii?Q?H5zCDvU9HhX6kcfPW3AJm146xQ=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: 22P4WKNRH56434KDJ4R7365KOUJFWLTI X-Message-ID-Hash: 22P4WKNRH56434KDJ4R7365KOUJFWLTI 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:120058] [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 reported by javanthropus (Jeremy Bopp). ---------------------------------------- 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 * 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/