Class: Mail::Utilities::BestEffortCharsetEncoder

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

Instance Method Summary collapse

Instance Method Details

#encode(string, charset) ⇒ Object



309
310
311
312
313
314
315
316
# File 'lib/mail/utilities.rb', line 309

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