Class: Mail::Ruby19::BestEffortCharsetEncoder

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

Instance Method Summary collapse

Instance Method Details

#encode(string, charset) ⇒ Object


18
19
20
21
22
23
24
25
# File 'lib/mail/version_specific/ruby_1_9.rb', line 18

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