We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StringIO
wb
StringIO does not set the ASCII-8BIT encoding when given the wb mode.
A minimal reproduction using the ghcr.io/graalvm/truffleruby-community Docker image is below.
ghcr.io/graalvm/truffleruby-community
# truffleruby --version truffleruby 24.0.1, like ruby 3.2.2, GraalVM CE Native [x86_64-linux]
irb(main):001:0> require 'stringio' => true irb(main):002:0> io = StringIO.new(String.new, 'wb') => #<StringIO:0x24b18> irb(main):003:0> io.write("Some Unicode characters: äöüß") => 33 irb(main):004:0> io.string => "Some Unicode characters: äöüß" irb(main):005:0> io.string.encoding => #<Encoding:UTF-8>
irb(main):001:0> require 'stringio' => true irb(main):002:0> io = StringIO.new(String.new, 'wb') => #<StringIO:0x00007f92a0cc91a8> irb(main):003:0> io.write("Some Unicode characters: äöüß") => 33 irb(main):004:0> io.string => "Some Unicode characters: \xC3\xA4\xC3\xB6\xC3\xBC\xC3\x9F" irb(main):005:0> io.string.encoding => #<Encoding:ASCII-8BIT>
Ruby 2.7 through 3.3 and JRuby also seem to return ASCII-8BIT Strings.
The text was updated successfully, but these errors were encountered:
Thank you for the report, we'll look into it.
Sorry, something went wrong.
740eddb
Fix StringIO#initialize and preserve initial string's encoding when m…
612518f
…ode is `w` so the initial string is truncated * close oracle/truffleruby#3599
andrykonchin
No branches or pull requests
StringIO
does not set the ASCII-8BIT encoding when given thewb
mode.A minimal reproduction using the
ghcr.io/graalvm/truffleruby-community
Docker image is below.TruffleRuby 24.0.1
# truffleruby --version truffleruby 24.0.1, like ruby 3.2.2, GraalVM CE Native [x86_64-linux]
Ruby 3.2.2
Ruby 2.7 through 3.3 and JRuby also seem to return ASCII-8BIT Strings.
The text was updated successfully, but these errors were encountered: