mail-jenc 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e4ccae9e4e2f5a00fb507ba9aad493b525a570787bb477bfddc0c85cfc91264e
4
- data.tar.gz: 78a3509aca7bb5d9d259bee3a2e555a7dc8f6954e997f044b87c298e855108d4
3
+ metadata.gz: 32da2bde725e3d20eab75a686cc14d111d9be8c01f5ab2b54fbd2fa57e8b9ad0
4
+ data.tar.gz: 65503198ba6b1e3ddcfd27c495614e003c1e368ae6ec2b2935da219e9e3d6d2b
5
5
  SHA512:
6
- metadata.gz: 71f6f52c5deab29db6167f6ae53a9ee47c0bfe0f7edd267cd1ec3fbaa377130ce9f621d5bcf5214eb3ca13438c4aabe39d82e0ba81a4026db3c8cf710d306e16
7
- data.tar.gz: c1190431e2fbd9d635b1de0d426d5e22f6c645ff9357526a2e8ff7d2203b24a79dec745632cc72bc9befd49c67ca10fd55ecdc3d6ba62cd687785aec9e09764c
6
+ metadata.gz: dd7a383c86ccfbccd98f10f7ad2b0c517afa1b2588bdbe5cf3401d3dd24c633847f11d2c5cbd2e9461d163a565aa28911e21d9de58018a4e685b03bc2042e3e8
7
+ data.tar.gz: 142b1c5a9ed24ed17f0f1ee3b0ab6a141d61156f1b824130d93a3ed8e19d6643e17c75929a235389d957993a7127e959ace8a97b7b1013f7f5400a8b87b4953f
@@ -6,7 +6,7 @@ module Mail
6
6
  if name && !name.ascii_only? && name.encoding == Encoding::UTF_8 && value.is_a?(Hash) && (charset = value.delete(:header_charset))
7
7
  mime_type = set_mime_type(name)
8
8
  transcoded = Mail::Encodings.transcode_charset(name, name.encoding, charset)
9
- if Jenc.rfc2231
9
+ if value.key?(:rfc2231) ? value[:rfc2231] : Jenc.rfc2231
10
10
  encoded = RFC2231Encoder.encode(transcoded, charset: charset)
11
11
  value[:content_disposition] ||= %Q|#{@content_disposition_type}; #{encoded}|
12
12
  encoded = Mail::Encodings.b_value_encode(transcoded)
@@ -3,7 +3,7 @@ module Mail
3
3
  module AddressFieldPatch
4
4
  def initialize(value, charset = nil)
5
5
  if Jenc.enabled?
6
- if value.is_a?(String) && !value.ascii_only? && value.encoding == Encoding::UTF_8 && charset && charset != 'utf-8'
6
+ if value.is_a?(String) && !value.ascii_only? && value.encoding == Encoding::UTF_8 && charset && charset.downcase != 'utf-8'
7
7
  list = Mail::AddressList.new(value)
8
8
  list.addresses.each do |addr|
9
9
  if addr.display_name && !addr.display_name.ascii_only?
@@ -3,7 +3,7 @@ module Mail
3
3
  module UnstructuredFieldPatch
4
4
  def initialize(name, value, charset = nil)
5
5
  if Jenc.enabled?
6
- if value.is_a?(String) && value.encoding == Encoding::UTF_8 && charset && charset != 'utf-8'
6
+ if value.is_a?(String) && value.encoding == Encoding::UTF_8 && charset && charset.downcase != 'utf-8'
7
7
  if !value.ascii_only?
8
8
  value = Mail::Encodings.b_value_encode(
9
9
  Mail::Encodings.transcode_charset(value, value.encoding, charset)
@@ -3,7 +3,7 @@ module Mail
3
3
  module MessagePatch
4
4
  def body=(value)
5
5
  if Jenc.enabled?
6
- if value.is_a?(String) && !value.ascii_only? && value.encoding == Encoding::UTF_8 && charset && charset != 'utf-8' && @transport_encoding.to_s != '8bit'
6
+ if value.is_a?(String) && !value.ascii_only? && value.encoding == Encoding::UTF_8 && charset && charset.downcase != 'utf-8' && @transport_encoding.to_s != '8bit'
7
7
  value = Mail::Encodings.transcode_charset(value, value.encoding, charset)
8
8
  value.force_encoding('us-ascii') if @transport_encoding.to_s == '7bit'
9
9
  value = @transport_encoding.encode(value)
@@ -1,5 +1,5 @@
1
1
  module Mail
2
2
  module Jenc
3
- VERSION = '1.0.3'
3
+ VERSION = '1.0.4'
4
4
  end
5
5
  end
data/lib/mail/jenc.rb CHANGED
@@ -25,7 +25,7 @@ module Mail
25
25
  end
26
26
 
27
27
  self.enable
28
- self.rfc2231 = true
28
+ self.rfc2231 = false
29
29
  self.preferred_charsets = {
30
30
  'iso-2022-jp' => 'cp50221',
31
31
  'shift_jis' => 'cp932'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mail-jenc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoshikazu Kaneta
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-14 00:00:00.000000000 Z
11
+ date: 2019-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mail