Sha256: 95f57be54ab5a7c42958799508f7881396abbae86d38da413c5a7842370cb5a7

Contents?: true

Size: 412 Bytes

Versions: 3

Compression:

Stored size: 412 Bytes

Contents

# frozen_string_literal: true

module Mail
  module Jdec
    module BodyPatch
      def decoded
        super
      rescue Mail::UnknownEncodingType => e
        if Jdec.enabled?
          Jdec::Decoder.force_utf8(raw_source)
        else
          raise e
        end
      end
    end
  end
end

unless Mail::Body.included_modules.include?(Mail::Jdec::BodyPatch)
  Mail::Body.prepend Mail::Jdec::BodyPatch
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mail-jdec-1.1.2 lib/mail/jdec/body_patch.rb
mail-jdec-1.1.1 lib/mail/jdec/body_patch.rb
mail-jdec-1.1.0 lib/mail/jdec/body_patch.rb