Method: TMail::Decoder.decode

Defined in:
lib/tmail/encode.rb

.decode(str, encoding = nil) ⇒ Object



122
123
124
125
126
# File 'lib/tmail/encode.rb', line 122

def self.decode( str, encoding = nil )
  encoding ||= (OUTPUT_ENCODING[TMail.KCODE] || 'j')
  opt = '-mS' + encoding
  str.gsub(ENCODED_WORDS) {|s| NKF.nkf(opt, s) }
end