Bug #8642
closedUnexpected behavior of String#split with UTF-32 encoded string.
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>
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
- test/ruby/test_string.rb (test_split): test for r41994.
[ruby-core:56036] [Bug #8642]