CARVIEW |
Select Language
HTTP/2 200
cache-control: max-age=0, private, must-revalidate
content-type: text/html; charset=utf-8
etag: W/"f8d348fcd27c4f2a19cbe09fe5c9ab4e"
nel: {"report_to":"heroku-nel","response_headers":["Via"],"max_age":3600,"success_fraction":0.01,"failure_fraction":0.1}
referrer-policy: strict-origin-when-cross-origin
report-to: {"group":"heroku-nel","endpoints":[{"url":"https://nel.heroku.com/reports?s=kz9BjbdyfhjwdZMjJDck%2BG9wKAu2gHfYmq2PG%2F0xeHw%3D\u0026sid=e11707d5-02a7-43ef-b45e-2cf4d2036f7d\u0026ts=1753403815"}],"max_age":3600}
reporting-endpoints: heroku-nel="https://nel.heroku.com/reports?s=kz9BjbdyfhjwdZMjJDck%2BG9wKAu2gHfYmq2PG%2F0xeHw%3D&sid=e11707d5-02a7-43ef-b45e-2cf4d2036f7d&ts=1753403815"
server: Heroku
set-cookie: _redmine_session=bjI5eVowV3NIVGw4SUxXOFNxTXpYeHNlQkpUdW9mS2dBSkw1aEtFVE9ZRVd5ZG41OUV2K2dQU0RZaEdjNnR5NmZHQkJiQWNBOVlYN3J6ZVhHK01xNWlGQnB3RWNNakhHR1NCbzJJWGJHY29oQXlBZ0N6TG84VjZxczF6WWRsTXhCN0pkKzZNK29jak1SL1Q1UmZnanNtNnJBaTU3aFRtWkVHaGNMTFEyTmt3MVlhZ0RIdTc0YmJlNWtDci9nZGEwLS1tSWl1Y2NoOHUxQ1dDanZlTEFhMEp3PT0%3D--74185e9eb2dccb82990a70c1a96c1db0b5c68e6f; path=/; secure; httponly; samesite=lax
strict-transport-security: max-age=63072000; includeSubDomains
vary: Accept
via: 2.0 heroku-router
x-content-type-options: nosniff
x-download-options: noopen
x-frame-options: SAMEORIGIN
x-permitted-cross-domain-policies: none
x-request-id: b8e36df1-54cd-6cda-57cb-ba0e03115fb2
x-runtime: 0.129690
x-xss-protection: 1; mode=block
content-length: 26475
date: Fri, 25 Jul 2025 00:36:56 GMT
Bug #21517: Behaviour of StringIO#readpartial with multibyte differs from IO#readpartial - Ruby - Ruby Issue Tracking System
[ruby-core:122817]
Project
General
Profile
Tags
Custom queries
Actions
Bug #21517
openBehaviour of StringIO#readpartial with multibyte differs from IO#readpartial
Added by herwin (Herwin W) 6 days ago.
Status:
Open
Assignee:
-
Target version:
-
ruby -v:
ruby 3.4.5 (2025-07-16 revision 20cda200d3) +PRISM [x86_64-linux] (+ others)
Description
The specs for IO#readpartial
have the following test (https://github.com/ruby/spec/blob/ed254bae321221f5cd24280beb37e5bddaff6bb6/core/io/readpartial_spec.rb#L41-L47):
before :each do
@rd, @wr = IO.pipe
@rd.binmode
@wr.binmode
end
it "reads after ungetc with multibyte characters in the buffer" do
@wr.write("∂φ/∂x = gaîté")
c = @rd.getc
@rd.ungetc(c)
@rd.readpartial(3).should == "\xE2\x88\x82"
@rd.readpartial(3).should == "\xCF\x86/"
end
This behaviour is different in StringIO#readpartial
. If I add this as a spec:
it "reads after ungetc with multibyte characters in the buffer" do
@string = StringIO.new(+"∂φ/∂x = gaîté")
c = @string.getc
@string.ungetc(c)
@string.readpartial(3).should == "\xE2\x88\x82"
@string.readpartial(3).should == "\xCF\x86/"
end
it fails with every supported Ruby version, and even with 3.5-dev of today, with the message Expected "\xE2\x88\x82" == "∂"
The getc
+ ungetc
can be removed, but this does not change the behaviour.
No data to display
Actions
Like0
Powered by Redmine © 2006-2025 Jean-Philippe Lang
Loading...