mailcvt 0.2.21 → 0.2.22

Sign up to get free protection for your applications and to get access to all the features.
data/lib/encoded_word.rb CHANGED
@@ -106,13 +106,17 @@ class EncodedWord
106
106
 
107
107
  def mime_decode(input, out_charset = 'utf-8')
108
108
  return '' unless input and input.length > 0
109
- ret = input.sub!(/=\?([A-Za-z0-9_-]+)\?([BQbq])\?([^\?]+)\?=/) {
110
- charset = $1
111
- enc = $2.upcase
112
- word = $3
113
- word = word.unpack({ "B"=>"m*", "Q"=>"M*" }[enc]).first
114
- word.encode(out_charset, charset, :undef=>:replace, :invalid=>:replace)
115
- }
116
- return ret ? mime_decode(input) : input
109
+ begin
110
+ ret = input.sub!(/=\?([A-Za-z0-9_-]+)\?([BQbq])\?([^\?]+)\?=/) {
111
+ charset = $1
112
+ enc = $2.upcase
113
+ word = $3
114
+ word = word.unpack({ "B"=>"m*", "Q"=>"M*" }[enc]).first
115
+ word.encode(out_charset, charset, :undef=>:replace, :invalid=>:replace)
116
+ }
117
+ return ret ? mime_decode(input) : input
118
+ rescue
119
+ return input
120
+ end
117
121
  end
118
122
  end
@@ -1,3 +1,3 @@
1
1
  module Mailcvt
2
- VERSION = '0.2.21'
2
+ VERSION = '0.2.22'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailcvt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.21
4
+ version: 0.2.22
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: