Project

General

Profile

Backport #3633

String accessor [Fixnum, Fixnum] produces wrong result in 1.9.1

Added by minad (Daniel Mendler) about 9 years ago. Updated 2 months ago.

Status:
Closed
Priority:
Normal
[ruby-core:31556]

Description

=begin
Example irb session:

irb(main):001:0> ENCODING
=> #Encoding:UTF-8
irb(main):002:0> a = "x" * 42
=> "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
irb(main):003:0> a[a.length,a.length]
=> ""
irb(main):004:0> a = "ü" * 42
=> "üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüü"
irb(main):005:0> a[a.length,a.length]
=> "\x00\x00\x00\x00A\x00\x00\x00\x00\x00\x00\x00" <------------- What is that?

It seems that only the [Fixnum, Fixnum] accessor is affected but I will test the others too.
=end


Related issues

Is duplicate of Ruby master - Bug #2379: String#[] returns invalid values for short multibyte stringsClosed11/18/2009Actions

History

#1

Updated by nobu (Nobuyoshi Nakada) about 9 years ago

  • Category set to core
  • Status changed from Open to Assigned
  • Assignee set to yugui (Yuki Sonoda)
  • Priority changed from 5 to Normal

=begin

=end

#2

Updated by jeremyevans0 (Jeremy Evans) 2 months ago

  • Status changed from Assigned to Closed
  • Description updated (diff)

Also available in: Atom PDF