# File lib/mail/version_specific/ruby_1_9.rb, line 51 def Ruby19.b_value_decode(str) match = str.match(/\=\?(.+)?\?[Bb]\?(.+)?\?\=/m) if match charset = match[1] str = Ruby19.decode_base64(match[2]) str.force_encoding(pick_encoding(charset)) end decoded = str.encode("utf-8", :invalid => :replace, :replace => "") decoded.valid_encoding? ? decoded : decoded.encode("utf-16le", :invalid => :replace, :replace => "").encode("utf-8") end