Project

General

Profile

Actions

Bug #8642

closed

Unexpected behavior of String#split with UTF-32 encoded string.

Added by phasis68 (Heesob Park) almost 11 years ago. Updated almost 11 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.1.0dev (2013-07-16 trunk 41990) [i386-mingw32]
[ruby-core:56036]

Description

The recent revisions related with encoding r41964,r41965,r41968,r71969,r47970,r41973 raised many test failures and errors.

http://ci.rubyinstaller.org/job/ruby-trunk-x86-test-all/1796/console

Here is a simple test case.

C:\work>irb
irb(main):001:0> a = 'test'.encode('UTF-32BE')
=> "test"
irb(main):002:0> a.split
=> ["\u{F8493B6D}\u{12000000}\u{3000000}\u{E06DA102}"]
irb(main):003:0> a
=> "\u{5F203D20}\u{4952422E}\u{43757272}\u{656E7443}"

C:\work>irb
irb(main):001:0> a = 'abc,def'.encode('UTF-32LE')
=> "abc,def"
irb(main):002:0> sep = ','.encode('UTF-32LE')
=> ","
irb(main):003:0> a.split(sep)
=> ["abc", "\u{65746E6F}\u{6C2E7478}\u{5F747361}"]
irb(main):004:0> a
=> "\u{203D205F}\u{2E425249}\u{72727543}\u{43746E65}\u{65746E6F}\u{6C2E7478}\u{5F747361}"
irb(main):005:0>

Actions #1

Updated by nobu (Nobuyoshi Nakada) almost 11 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r42002.
Heesob, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


test_string.rb: Bug #8642

Actions

Also available in: Atom PDF

Like0
Like0