From: "Y. NOBUOKA" Date: 2011-04-24T22:28:09+09:00 Subject: Re: Does String#encode in Ruby 1.9.2 have option :fallback? > I want to do this, but failed. It seems :fallback cannot be a dynamic > hash? No, it can't on ruby 1.9.2p180... However, this feature has been requested and was accepted [1], so you can use this feature on ruby 1.9.3dev! [1] http://redmine.ruby-lang.org/issues/4125 (Japanese) $ ruby -v ruby 1.9.3dev (2011-04-24 trunk 31329) [x86_64-linux] $ irb ruby-head :001 > h = Hash.new{ 'a' } => {} ruby-head :002 > "\u3042".encode Encoding::ASCII, fallback: h => "a" -- NOBUOKA Yu