Class: Mail::Ruby19::StrictCharsetEncoder

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


7
8
9
10
11
12
13
14
# File 'lib/mail/version_specific/ruby_1_9.rb', line 7

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