mail-jdec 1.0.4 → 1.0.5

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: 880f1f6ecdd0e34f0844fe398d29bfcb13587c5a93aef0b2bcd42e1a7dbb6319
4
- data.tar.gz: 9a135d5433d8cb1af49178d9e0a80a2884a1955d59f5391c0beac9417d343715
3
+ metadata.gz: ff7600ea968171f557f4e467372e10a7a6535d990e4623ce89fe9fe2b31a2b2e
4
+ data.tar.gz: cd62273ede16c68c13b2fa9edcb58391d76fa0cf8e8944f61837e3f83b6f00f2
5
5
  SHA512:
6
- metadata.gz: 654dde35ada8044faf9cd06addb0876c27604a32cc7463055615a7684e6021e574a40686c24660979ec71ade8b7c8cffa316fffa1cadb8b54be95b319fbdcdce
7
- data.tar.gz: ee99673c7b744c5a880e4e1a752d4afebc5784a6850f1e2dfbc31bdc3e88b7d082d4e985cb51bbdb38c23c12116e73d4c4f7a128730647811e25b3e105f944f4
6
+ metadata.gz: '098f579097cffa49a382a7678e7bb9e7321946bc791919a021528c841f6b9bbcbfdefa43fec420bd882ee5e1e2873e2bf4ab4de1034a1ccc26f310c2e787ee7c'
7
+ data.tar.gz: 35be3c8675a4accb64b7552c9aaaa604e8b3d27fa609e1e53a1fe44909368f0615ab28c0d31fc878f64b801182fdc65a12193059adf03a577e9d6060ec24f9bd
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.0.5
4
+
5
+ * Force utf-8 when charset is not detected.
6
+
3
7
  ## 1.0.4
4
8
 
5
9
  * Sanitize some wrong parameters for content type and content disposition.
@@ -20,7 +20,7 @@ module Mail
20
20
  def trusty?(detected)
21
21
  detected.key?(:type) &&
22
22
  detected.key?(:encoding) &&
23
- detected[:confidence].to_i > Jdec.autodetect_confidence &&
23
+ detected[:confidence].to_i >= Jdec.autodetect_confidence &&
24
24
  !Jdec.autodetect_skip_charsets.include?(detected[:encoding].downcase)
25
25
  end
26
26
  end
@@ -8,9 +8,11 @@ module Mail
8
8
  detected = Detector.detect(decoded)
9
9
  if detected && detected[:type] == :text
10
10
  charset = detected[:encoding].downcase
11
- decoded = Mail::Encodings.transcode_charset(decoded.dup.force_encoding(charset), charset)
11
+ decoded = Mail::Encodings.transcode_charset(decoded.dup.force_encoding(charset), charset, 'utf-8')
12
12
  header[:content_type] = 'text/plain'
13
13
  header[:content_type].parameters[:charset] = charset
14
+ else
15
+ decoded = Mail::Encodings.transcode_charset(decoded, decoded.encoding, 'utf-8')
14
16
  end
15
17
  end
16
18
 
@@ -1,5 +1,5 @@
1
1
  module Mail
2
2
  module Jdec
3
- VERSION = '1.0.4'
3
+ VERSION = '1.0.5'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mail-jdec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoshikazu Kaneta
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-19 00:00:00.000000000 Z
11
+ date: 2019-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mail
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  - !ruby/object:Gem::Version
134
134
  version: '0'
135
135
  requirements: []
136
- rubygems_version: 3.0.1
136
+ rubygems_version: 3.0.3
137
137
  signing_key:
138
138
  specification_version: 4
139
139
  summary: A mail patch for decoding some inproper mails