vmail 2.7.0 → 2.7.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -75,7 +75,8 @@ The `.vmailrc` file should look something like this. Substitute your own values.
75
75
  --
76
76
  Sent from Vmail. http://danielchoi.com/software/vmail.html
77
77
 
78
- This file should be formatted in [YAML syntax][1].
78
+ This file should be formatted in [YAML syntax][1]. If you have any unsual
79
+ characters in a string value, try putting quotes around that value.
79
80
 
80
81
  [1]:http://www.yaml.org/spec/1.2/spec.html
81
82
 
@@ -2,8 +2,6 @@ require 'vmail/version'
2
2
  require 'vmail/options'
3
3
  require 'vmail/query'
4
4
  require 'vmail/message_formatter'
5
-
6
- require 'iconv'
7
5
  require 'versionomy'
8
6
 
9
7
  module Vmail
@@ -1,6 +1,5 @@
1
1
  require 'mail'
2
2
  require 'open3'
3
- require 'iconv'
4
3
 
5
4
  module Vmail
6
5
  class MessageFormatter
@@ -82,7 +81,7 @@ module Vmail
82
81
  output = "[vmail: html part translated into plaintext by '#{html_tool}']\n\n" + stdout.read
83
82
  charset = part.content_type_parameters && part.content_type_parameters['charset']
84
83
  if charset && charset != 'UTF-8'
85
- Iconv.conv('UTF-8//TRANSLIT//IGNORE', charset, output)
84
+ output.encode!('utf-8', charset, undef: :replace, invalid: :replace)
86
85
  else
87
86
  output
88
87
  end
@@ -109,12 +108,12 @@ module Vmail
109
108
  def utf8(string, this_encoding = encoding)
110
109
  return '' unless string
111
110
  out = if this_encoding && this_encoding.upcase != 'UTF-8'
112
- Iconv.conv('UTF-8//TRANSLIT/IGNORE', this_encoding, string)
111
+ string.encode!('utf-8', this_encoding, undef: :replace, invalid: :replace)
113
112
  elsif this_encoding.upcase == 'UTF-8'
114
113
  string
115
114
  else
116
- # assume UTF-8
117
- Iconv.conv('US-ASCII//TRANSLIT/IGNORE', 'UTF-8', string)
115
+ # assume UTF-8 and convert to ascii
116
+ string.encode!('us-ascii', 'utf-8', undef: :replace, invalid: :replace)
118
117
  end
119
118
  out
120
119
  rescue
@@ -1,5 +1,3 @@
1
- require 'iconv'
2
-
3
1
  module Vmail
4
2
 
5
3
  module ShowingHeaders
@@ -70,11 +70,9 @@ module Vmail
70
70
  # [\w-]+ matches charsets like ISO-8851
71
71
  if /charset=([\w-]+)/.match(parts_list)
72
72
  conv_from = /charset=([\w-]+)/.match(parts_list)[1].strip
73
- body.force_encoding conv_from
74
- body = body.encode!('utf-8', undef: :replace, invalid: :replace)
73
+ body = body.encode!('utf-8', conv_from, undef: :replace, invalid: :replace)
75
74
  else
76
- body.force_encoding "utf-8"
77
- body = body.encode!('us-ascii', undef: :replace, invalid: :replace)
75
+ body = body.encode!('us-ascii', 'utf-8', undef: :replace, invalid: :replace)
78
76
  end
79
77
  message_text = <<-EOF
80
78
  #{message_id} #{number_to_human_size message.size} #{message.flags} #{parts_list}
@@ -86,8 +84,7 @@ EOF
86
84
  # 2 calls so we can see more fine grained exceptions
87
85
  message.update(:rfc822 => rfc822)
88
86
  if !message_text.valid_encoding?
89
- ic = Iconv.new('UTF-8//IGNORE', 'UTF-8')
90
- message_text = ic.iconv(message_text)
87
+ message_text.encode!('utf-8', undef: :replace, invalid: :replace)
91
88
  end
92
89
 
93
90
  begin
@@ -1,3 +1,3 @@
1
1
  module Vmail
2
- VERSION = '2.7.0'
2
+ VERSION = '2.7.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vmail
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.0
4
+ version: 2.7.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: