This file is indexed.

/usr/lib/ruby/vendor_ruby/charlock_holmes/encoding_detector.rb is in ruby-charlock-holmes 0.6.9.4.dfsg1-1build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
module CharlockHolmes
  class EncodingDetector
    alias :strip_tags? :strip_tags

    # Attempt to detect the encoding of this string
    #
    # NOTE: This will create a new CharlockHolmes::EncodingDetector instance on every call
    #
    # str      - a String, what you want to detect the encoding of
    # hint_enc - an optional String (like "UTF-8"), the encoding name which will
    #            be used as an additional hint to the charset detector
    #
    # Returns: a Hash with :encoding, :language, :type and :confidence
    def self.detect(str, hint_enc=nil)
      new.detect(str, hint_enc)
    end

    # Attempt to detect the encoding of this string, and return
    # a list with all the possible encodings that match it.
    #
    # NOTE: This will create a new CharlockHolmes::EncodingDetector instance on every call
    #
    # str      - a String, what you want to detect the encoding of
    # hint_enc - an optional String (like "UTF-8"), the encoding name which will
    #            be used as an additional hint to the charset detector
    #
    # Returns: an Array with zero or more Hashes,
    # each one of them with with :encoding, :language, :type and :confidence
    def self.detect_all(str, hint_enc=nil)
      new.detect_all(str, hint_enc)
    end
  end
end