From: John Firebaugh Date: 2012-02-05T08:28:13+09:00 Subject: [ruby-core:42354] [ruby-trunk - Bug #5968][Open] Encoding.compatible? with binary string Issue #5968 has been reported by John Firebaugh. ---------------------------------------- Bug #5968: Encoding.compatible? with binary string https://bugs.ruby-lang.org/issues/5968 Author: John Firebaugh Status: Open Priority: Normal Assignee: Category: Target version: ruby -v: ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin10.8.0] =begin According to #5920: The original meaning of Encoding.compatible?(str1, str2) is the encoding of concatenated string. In other codes, it is str = str1.dup.concat str2 str.encoding <- this! But observe: a = "a".force_encoding("binary") b = "b".force_encoding("us-ascii") a.dup.concat(b).encoding #=> # Encoding.compatible?(a, b) #=> # I believe the latter should return #. =end -- http://bugs.ruby-lang.org/