Method: Linguist::BlobHelper#detect_encoding
- Defined in:
- lib/linguist/blob_helper.rb
#detect_encoding ⇒ Object
Try to guess the encoding
Returns: a Hash, with :encoding, :confidence, :type
this will return nil if an error occurred during detection or
no valid encoding could be found
124 125 126 |
# File 'lib/linguist/blob_helper.rb', line 124 def detect_encoding @detect_encoding ||= CharlockHolmes::EncodingDetector.new.detect(data) if data end |