Class: Mail::Jdec::Detector

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

Class Method Summary collapse

Class Method Details

.detect(text) ⇒ Object



7
8
9
10
11
12
# File 'lib/mail/jdec/detector.rb', line 7

def detect(text)
  return if text.nil?

  detected = CharlockHolmes::EncodingDetector.detect(text)
  detected if trusty?(detected) && find_encoding(detected)
end