Class: Mail::Utilities::StrictCharsetEncoder

Inherits:
Object
  • Object
show all
Defined in:
lib/mail/utilities.rb

Instance Method Summary collapse

Instance Method Details

#encode(string, charset) ⇒ Object



298
299
300
301
302
303
304
305
# File 'lib/mail/utilities.rb', line 298

def encode(string, charset)
  case charset
  when /utf-?7/i
    Mail::Utilities.decode_utf7(string)
  else
    string.force_encoding(Mail::Utilities.pick_encoding(charset))
  end
end