Bug #8642

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

Added by Heesob Park 9 months ago. Updated 9 months ago.

[ruby-core:56036]
Status:Closed
Priority:Normal
Assignee:-
Category:-
Target version:-
ruby -v:ruby 2.1.0dev (2013-07-16 trunk 41990) [i386-mingw32] Backport:1.9.3: UNKNOWN, 2.0.0: UNKNOWN

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>

Associated revisions

Revision 42002
Added by Nobuyoshi Nakada 9 months ago

test_string.rb: Bug #8642

  • test/ruby/teststring.rb (testsplit): test for r41994. [Bug #8642]

History

#1 Updated by Nobuyoshi Nakada 9 months 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

  • test/ruby/teststring.rb (testsplit): test for r41994. [Bug #8642]

Also available in: Atom PDF