mail-jdec 1.0.6 → 1.0.7

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: bf5bd547638b25fe2e32d1e8af6afff6d5f368760ebb481f02be5b90ea81811f
4
- data.tar.gz: e01268d216f0eec762a15d8dc98416339cf37b8a47d542757ee50ec0b1807269
3
+ metadata.gz: 771926a9ac210b89bde65b6a6081baa75cfe1cc18ef51a7e549615c2760be0bb
4
+ data.tar.gz: 21bf2742a6b42daeb24da45d7a60a2eb09e6f7ce278ebd4b38d7203f8d97b1e2
5
5
  SHA512:
6
- metadata.gz: cf4eb546d479f4a1b86e755790aef3bae4136043f295ee33946e62b028fa7fea65f992df1a0295ff4bdb7ae8eefd012ebf1cb204c7a9b40faeaaf47051fb60bd
7
- data.tar.gz: 7ec8a6747dd5bd0eba21ef47c4c577ddaf6bb1fedd7e77848bb9c1102cc042c4eda4b221e3c65aa7e7b8fc168a98d941048c74616a1e1b9084f7d6791dba46a3
6
+ metadata.gz: 9e6e9f45f57696da4535d8cff239de15b7a4e2b907043595165e2176392c4ae6b57d650e9759157601a414c17e0142fc3cb2628a7c08713515c9e37a0d15b937
7
+ data.tar.gz: 7a150a01169bc9f17e784a22bb0978ebdb3c61d02f7c6155dd252ebe97b271fbe2f9a9817e31fd9a450f7b287a20b85445b3485a0e84baa208e6843e793df206
@@ -1,5 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.0.7
4
+
5
+ * Force us-ascii when header's charset is not detected.
6
+ * Make autodetect_skip_charsets empty by default.
7
+
3
8
  ## 1.0.6
4
9
 
5
10
  * Fix decoding for invalid ascii characters in mail header.
@@ -28,7 +28,7 @@ module Mail
28
28
 
29
29
  self.enable
30
30
  self.autodetect_confidence = 50
31
- self.autodetect_skip_charsets = %w(utf-8 iso-8859-1)
31
+ self.autodetect_skip_charsets = %w()
32
32
  self.preferred_charsets = {
33
33
  'iso-2022-jp' => 'cp50221',
34
34
  'iso-2022-jp-1' => 'cp50221',
@@ -6,9 +6,12 @@ module Mail
6
6
  return text if text.nil? || text.encoding == Encoding::UTF_8
7
7
 
8
8
  detected = Detector.detect(text)
9
+
9
10
  if detected
10
11
  charset = detected[:encoding].to_s
11
- text = Mail::Encodings.transcode_charset(text.dup.force_encoding(charset), charset)
12
+ text = Mail::Encodings.transcode_charset(text.dup.force_encoding(charset), charset, 'utf-8')
13
+ else
14
+ text = Mail::Encodings.transcode_charset(text, text.encoding, 'us-ascii')
12
15
  end
13
16
 
14
17
  text
@@ -1,5 +1,5 @@
1
1
  module Mail
2
2
  module Jdec
3
- VERSION = '1.0.6'
3
+ VERSION = '1.0.7'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mail-jdec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoshikazu Kaneta