From: John Firebaugh Date: 2012-01-13T07:02:28+09:00 Subject: [ruby-core:42095] [ruby-trunk - Bug #5848] Array#inspect having an element with non-ASCII compatible #inspect result Issue #5848 has been updated by John Firebaugh. =begin Hmm, not sure that r34218 fully addresses the issue. o = Object.new def o.inspect "abc".encode(Encoding.default_external) end Encoding.default_external = Encoding::UTF_16BE [o].inspect #=> "\u5B00\u6100\u6200\u635D" =end ---------------------------------------- Bug #5848: Array#inspect having an element with non-ASCII compatible #inspect result https://bugs.ruby-lang.org/issues/5848 Author: John Firebaugh Status: Closed Priority: Normal Assignee: Category: Target version: ruby -v: ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin10.8.0] Is this a bug? >> class O >> def inspect >> "foo".encode!(Encoding::UTF_16BE) >> end >> end => nil >> [O.new].inspect => "\u5B00\u6600\u6F00\u6F5D" -- http://bugs.ruby-lang.org/