Project

General

Profile

Actions

Backport #3633

closed

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

Added by Anonymous over 13 years ago. Updated over 4 years ago.

Status:
Closed
[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 1 (0 open1 closed)

Is duplicate of Ruby master - Bug #2379: String#[] returns invalid values for short multibyte stringsClosednaruse (Yui NARUSE)11/18/2009Actions
Actions #1

Updated by nobu (Nobuyoshi Nakada) over 13 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

Actions #2

Updated by jeremyevans0 (Jeremy Evans) over 4 years ago

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

Also available in: Atom PDF

Like0
Like0Like0