module Mail::Jenc::Ruby19Patch

Public Class Methods

preferred_charset(charset) click to toggle source
# File lib/mail/jenc/ruby_1_9_patch.rb, line 14
def preferred_charset(charset)
  Jenc.preferred_charsets[charset.to_s.downcase] || charset
end

Public Instance Methods

transcode_charset(str, from_encoding, to_encoding = Encoding::UTF_8) click to toggle source
Calls superclass method
# File lib/mail/jenc/ruby_1_9_patch.rb, line 4
def transcode_charset(str, from_encoding, to_encoding = Encoding::UTF_8)
  if Jenc.enabled?
    coded = super(str, from_encoding, Ruby19Patch.preferred_charset(to_encoding))
    coded.force_encoding(to_encoding)
  else
    super
  end
end