From: "mame (Yusuke Endoh)" Date: 2012-11-25T13:08:15+09:00 Subject: [ruby-core:50068] [ruby-trunk - Bug #7431][Rejected] Encoding.compatible? results are order-dependent for Strings but not Encodings Issue #7431 has been updated by mame (Yusuke Endoh). Status changed from Open to Rejected ---------------------------------------- Bug #7431: Encoding.compatible? results are order-dependent for Strings but not Encodings https://bugs.ruby-lang.org/issues/7431#change-33847 Author: brixen (Brian Ford) Status: Rejected Priority: Normal Assignee: Category: Target version: ruby -v: ruby 1.9.3p286 (2012-10-12 revision 37165) [x86_64-darwin10.8.0] Could someone please explain the following? 1.9.3p286 :001 > Encoding.compatible? "euc-jp", "utf-8" => # 1.9.3p286 :002 > Encoding.compatible? "utf-8", "euc-jp" => # 1.9.3p286 :003 > a = "a".force_encoding "utf-8" => "a" 1.9.3p286 :004 > b = "b".force_encoding "euc-jp" => "b" 1.9.3p286 :005 > Encoding.compatible? a, b => # 1.9.3p286 :006 > Encoding.compatible? b, a => # 1.9.3p286 :007 > Encoding.compatible? a, "euc-jp" => # 1.9.3p286 :008 > Encoding.compatible? "euc-jp", a => # 1.9.3p286 :009 > Encoding.compatible? b, "utf-8" => # 1.9.3p286 :010 > Encoding.compatible? "utf-8", b => # Thanks, Brian -- http://bugs.ruby-lang.org/