def import(have)
      begin
        data = File.read(have.file)
      rescue
        @report << "Failure while reading #{have.file}"
        raise AbortJob
      end

      begin
        if [:detect, :charlock_holmes].include?(have.encoding) && defined?(CharlockHolmes)
          detection = CharlockHolmes::EncodingDetector.detect(data)
          @report << "Assuming #{detection[:encoding]} for #{have.file} (detected by charlock_holmes with #{detection[:confidence]}% confidence)"
          data.force_encoding(detection[:encoding])
        elsif [:detect, :rchardet19].include?(have.encoding) && defined?(CharDet)
          detection = CharDet.detect(data)
          @report << "Assuming #{detection.encoding} for #{have.file} (detected by rchardet19 with #{(detection.confidence * 100).to_i}% confidence)"
          data.force_encoding(detection.encoding)
        else
          @report << "Assuming #{have.encoding} for #{have.file} (user-supplied)"
          data.force_encoding(have.encoding)
        end
      rescue
        @report << "Failure while setting encoding for #{have.file}"
        raise AbortJob
      end

      begin
        data.encode!('UTF-8')
      rescue
        @report << "Failure while transcoding #{have.file} from #{data.encoding} to intermediate UTF-8 encoding"
        raise AbortJob
      end

      begin
        have.subtitles =
          case File.extname(have.file)
          when '.ass'
            ASS.import(data)
          when '.ssa'
            SSA.import(data)
          when '.srt'
            SRT.import(data)
          when '.yt'
            YT.import(data)
          else
            fail 'Not supported'
          end
      rescue
        @report << "Failure while importing #{File.extname(have.file)[1..3].upcase} from #{have.file}"
        raise AbortJob
      end
    end
def import(have)
      begin
        data = File.read(have.file)
      rescue
        @report << "Failure while reading #{have.file}"
        raise AbortJob
      end

      begin
        if [:detect, :charlock_holmes].include?(have.encoding) && defined?(CharlockHolmes)
          detection = CharlockHolmes::EncodingDetector.detect(data)
          @report << "Assuming #{detection[:encoding]} for #{have.file} (detected by charlock_holmes with #{detection[:confidence]}% confidence)"
          data.force_encoding(detection[:encoding])
        elsif [:detect, :rchardet19].include?(have.encoding) && defined?(CharDet)
          detection = CharDet.detect(data)
          @report << "Assuming #{detection.encoding} for #{have.file} (detected by rchardet19 with #{(detection.confidence * 100).to_i}% confidence)"
          data.force_encoding(detection.encoding)
        else
          @report << "Assuming #{have.encoding} for #{have.file} (user-supplied)"
          data.force_encoding(have.encoding)
        end
      rescue
        @report << "Failure while setting encoding for #{have.file}"
        raise AbortJob
      end

      begin
        data.encode!('UTF-8')
      rescue
        @report << "Failure while transcoding #{have.file} from #{data.encoding} to intermediate UTF-8 encoding"
        raise AbortJob
      end

      begin
        have.subtitles =
          case File.extname(have.file)
          when '.ass'
            ASS.import(data)
          when '.ssa'
            SSA.import(data)
          when '.srt'
            SRT.import(data)
          when '.yt'
            YT.import(data)
          else
            fail 'Not supported'
          end
      rescue
        @report << "Failure while importing #{File.extname(have.file)[1..3].upcase} from #{have.file}"
        raise AbortJob
      end
    end
Imports what we {Have}

 @param [Have] What we {Have}