From: saber ma Date: 2011-09-29T23:14:16+09:00 Subject: [ruby-core:39776] [Ruby 1.9 - Bug #5379][Open] the join method of array return different encoding result Issue #5379 has been reported by saber ma. ---------------------------------------- Bug #5379: the join method of array return different encoding result http://redmine.ruby-lang.org/issues/5379 Author: saber ma Status: Open Priority: Normal Assignee: Category: Target version: 1.9.3 ruby -v: ruby 1.9.3dev (2011-09-23 revision 33323) [i686-linux] ruby-1.9.3-rc1 :001 > [[], "������"].join => "������" This is fine. But is the last element is nil, the result is different. ruby-1.9.3-rc1 :002 > [[], "������", nil].join => "\xE4\xB8\xAD\xE6\x96\x87" It will cause some gems to raise error: incompatible character encodings: UTF-8 and US-ASCII This bug can be reproduct in ruby1.9.3 preview1 and rc1, but ruby1.9.2 p180 and p290 is ok. ruby-1.9.2-p180 :001 > [[], "������",nil].join => "������" ruby-1.9.2-p180 :002 > [[], "������"].join => "������" -- http://redmine.ruby-lang.org