Sha256: 89b9da1a4a8fe8f51b1f6d4fe4b2c94b18c0a12f5af03b5195468ccafe1d87ce

Contents?: true

Size: 659 Bytes

Versions: 14

Compression:

Stored size: 659 Bytes

Contents

# encoding: utf-8
# frozen_string_literal: true
require 'mail/encodings/8bit'

module Mail
  module Encodings
    # 7bit and 8bit are equivalent. 7bit encoding is for text only.
    class SevenBit < EightBit
      NAME = '7bit'
      PRIORITY = 1
      Encodings.register(NAME, self)

      def self.decode(str)
        ::Mail::Utilities.binary_unsafe_to_lf str
      end

      def self.encode(str)
        ::Mail::Utilities.binary_unsafe_to_crlf str
      end

      # Per RFC 2045 2.7. 7bit Data, No octets with decimal values greater than 127 are allowed.
      def self.compatible_input?(str)
        str.ascii_only? && super
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 5 rubygems

Version Path
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/mail-2.8.1/lib/mail/encodings/7bit.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/mail-2.8.1/lib/mail/encodings/7bit.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/mail-2.8.1/lib/mail/encodings/7bit.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/mail-2.8.1/lib/mail/encodings/7bit.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/mail-2.8.1/lib/mail/encodings/7bit.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/mail-2.8.1/lib/mail/encodings/7bit.rb
mail-2.8.1 lib/mail/encodings/7bit.rb
mail-2.8.1.rc2 lib/mail/encodings/7bit.rb
mail-2.8.0.1 lib/mail/encodings/7bit.rb
mail-2.8.0.1.rc1 lib/mail/encodings/7bit.rb
mail-2.8.0 lib/mail/encodings/7bit.rb
mail-2.8.0.rc3 lib/mail/encodings/7bit.rb
mail-2.8.0.rc2 lib/mail/encodings/7bit.rb
mail-2.8.0.rc1 lib/mail/encodings/7bit.rb