module ACSV::Detect::EncodingUChardet

Constants

DEFAULT_CONFIDENCE

Public Class Methods

encoding(data, options) click to toggle source
# File lib/acsv/detect/encoding_uchardet.rb, line 20
def self.encoding(data, options)
  if present?
    encdet = ::ICU::UCharsetDetector.detect(data)
    encdet[:encoding] if encdet[:confidence] > (options[:confidence] || DEFAULT_CONFIDENCE)*100
  end
end
present?() click to toggle source
# File lib/acsv/detect/encoding_uchardet.rb, line 16
def self.present?
  defined? ::ICU::UCharsetDetector
end
require_name() click to toggle source
# File lib/acsv/detect/encoding_uchardet.rb, line 12
def self.require_name
  'uchardet'
end